Scaled conjugate gradient backpropagation
net.trainFcn = 'trainscg'
[net,tr] = train(net,...)
trainscg is a network training function that
updates weight and bias values according to the scaled conjugate gradient
net.trainFcn = 'trainscg' sets the network
[net,tr] = train(net,...) trains the network
Training occurs according to
parameters, shown here with their default values:
Maximum number of epochs to train
Epochs between displays (NaN for no displays)
Generate command-line output
Show training GUI
Maximum time to train in seconds
Minimum performance gradient
Maximum validation failures
Determine change in weight for second derivative approximation
Parameter for regulating the indefiniteness of the Hessian
You can create a standard network that uses
To prepare a custom network to be trained with
to desired values.
In either case, calling
train with the resulting
network trains the network with
Here is a problem consisting of inputs
t to be solved with a network.
p = [0 1 2 3 4 5]; t = [0 0 0 1 1 1];
A two-layer feed-forward network with two hidden neurons and this training function is created.
net = feedforwardnet(2,'trainscg');
Here the network is trained and retested.
net = train(net,p,t); a = net(p)
help feedforwardnet and
cascadeforwardnet for other examples.
trainscg can train any network as long as
its weight, net input, and transfer functions have derivative functions.
Backpropagation is used to calculate derivatives of performance
respect to the weight and bias variables
The scaled conjugate gradient algorithm is based on conjugate
directions, as in
traincgb, but this algorithm does not perform
a line search at each iteration. See Moller (Neural Networks,
Vol. 6, 1993, pp. 525–533) for a more detailed discussion of
the scaled conjugate gradient algorithm.
Training stops when any of these conditions occurs:
The maximum number of
The maximum amount of
time is exceeded.
Performance is minimized to the
The performance gradient falls below
Validation performance has increased more than
since the last time it decreased (when using validation).
Moller, Neural Networks, Vol. 6, 1993, pp. 525–533