| Neural Network Toolbox | |
| Provide feedback about this page |
Conjugate gradient backpropagation with Polak-Ribiére updates
Syntax
Description
traincgp is a network training function that updates weight and bias values according to conjugate gradient backpropagation with Polak-Ribiére updates.
traincgp(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 traincgp's training parameters, shown here with their default values:
Parameters related to line search methods (not all used for all methods):
Network Use
You can create a standard network that uses traincgp with newff, newcf, or newelm. To prepare a custom network to be trained with traincgp,
net.trainFcn to 'traincgp'. This sets net.trainParam to traincgp's default parameters.
net.trainParam properties to desired values.
In either case, calling train with the resulting network trains the network with traincgp.
Examples
Here is a problem consisting of inputs p and targets t to be solved with a network.
A feed-forward network is created with a hidden layer of 2 neurons.
Here the network is trained and tested.
Algorithm
traincgp 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. Each variable is adjusted according to the following:
where dX is the search direction. The parameter a is selected to minimize the performance along the search direction. The line search function searchFcn is used to locate the minimum point. The first search direction is the negative of the gradient of performance. In succeeding iterations the search direction is computed from the new gradient and the previous search direction according to the formula
where gX is the gradient. The parameter Z can be computed in several different ways. For the Polak-Ribiére variation of conjugate gradient, it is computed according to
where norm_sqr is the norm square of the previous gradient, and gX_old is the gradient on the previous iteration. See page 78 of Scales (Introduction to Non-Linear Optimization, 1985) for a more detailed discussion of the 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
Scales, L.E., Introduction to Non-Linear Optimization, New York, Springer-Verlag, 1985
See Also
newff, newcf, traingdm, traingda, traingdx, trainlm, trainrp, traincgf, traincgb, trainscg, trainoss, trainbfg
| Provide feedback about this page |
![]() | traincgf | traingd | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |