| Neural Network Toolbox | |
| Provide feedback about this page |
Scaled conjugate gradient backpropagation
Syntax
Description
trainscg is a network training function that updates weight and bias values according to the scaled conjugate gradient method.
trainscg(net,TR,trainV,valV,testV) takes these inputs,
net |
Neural network |
TR |
Initial training record created by train |
trainV |
Training data created by train |
valV |
Validation data created by train |
testV |
Test data created by train |
net |
Trained network | |
TR |
Training record of various values over each epoch | |
Each argument trainV, valV, and testV is a structure of these fields:
Training occurs according to trainscg's training parameters, shown here with their default values:
trainscg('info') returns useful information about this function.
Network Use
You can create a standard network that uses trainscg with newff, newcf, or newelm. To prepare a custom network to be trained with trainscg,
net.trainFcn to 'trainscg'. This sets net.trainParam to trainscg's default parameters.
net.trainParam properties to desired values.
In either case, calling train with the resulting network trains the network with trainscg.
Examples
Here is a problem consisting of inputs p and targets t to be solved with a network.
Here a two-layer feed-forward network is created. The network's input ranges from [0 to 10]. The first layer has two tansig neurons, and the second layer has one logsig neuron. The trainscg network training function is to be used.
Here the network is trained and retested.
See newff, newcf, and newelm for other examples.
Algorithm
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 perf with respect to the weight and bias variables X.
The scaled conjugate gradient algorithm is based on conjugate directions, as in traincgp, traincgf, and traincgb, but this algorithm does not perform a line search at each iteration. See Moller (Neural Networks, Vol. 6, 1993, pp. 525 to 533) for a more detailed discussion of the scaled conjugate gradient algorithm.
Training stops when any of these conditions occurs:
epochs (repetitions) is reached.
time is exceeded.
goal.
min_grad.
max_fail times since the last time it decreased (when using validation).
Reference
Moller, Neural Networks, Vol. 6, 1993, pp. 525-533
See Also
newff, newcf, traingdm, traingda, traingdx, trainlm, trainrp, traincgf, traincgb, trainbfg, traincgp, trainoss
| Provide feedback about this page |
![]() | trains | tribas | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |