Main Content


Configure network inputs and outputs to best match input and target data


net = configure(net,x,t)
net = configure(net,x)
net = configure(net,'inputs',x,i)
net = configure(net,'outputs',t,i)


Configuration is the process of setting network input and output sizes and ranges, input preprocessing settings and output postprocessing settings, and weight initialization settings to match input and target data.

Configuration must happen before a network’s weights and biases can be initialized. Unconfigured networks are automatically configured and initialized the first time train is called. Alternately, a network can be configured manually either by calling this function or by setting a network’s input and output sizes, ranges, processing settings, and initialization settings properties manually.

net = configure(net,x,t) takes input data x and target data t, and configures the network’s inputs and outputs to match.

net = configure(net,x) configures only inputs.

net = configure(net,'inputs',x,i) configures the inputs specified with the index vector i. If i is not specified all inputs are configured.

net = configure(net,'outputs',t,i) configures the outputs specified with the index vector i. If i is not specified all targets are configured.


Here a feedforward network is created and manually configured for a simple fitting problem (as opposed to allowing train to configure it).

[x,t] = simplefit_dataset;
net = feedforwardnet(20); view(net)
net = configure(net,x,t); view(net)
Introduced in R2010b