| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Neural Network Toolbox |
| Contents | Index |
Conjugate gradient backpropagation with Fletcher-Reeves updates
traincgf is a network training function that updates weight and bias values according to conjugate gradient backpropagation with Fletcher-Reeves updates.
traincgf(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 traincgf's training parameters, shown here with their default values:
Parameters related to line search methods (not all used for all methods):
traincgf('info') returns useful information about this function.
You can create a standard network that uses traincgf with newff, newcf, or newelm.
To prepare a custom network to be trained with traincgf,
In either case, calling train with the resulting network trains the network with traincgf.
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.
traincgf 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 Fletcher-Reeves variation of conjugate gradient it is computed according to
where norm_sqr is the norm square of the previous gradient and normnew_sqr is the norm square of the current gradient. See page 78 of Scales (Introduction to Non-Linear Optimization) for a more detailed discussion of the algorithm.
Training stops when any of these conditions occurs:
Scales, L.E., Introduction to Non-Linear Optimization, New York, Springer-Verlag, 1985
newff, newcf, traingdm, traingda, traingdx, trainlm, traincgb, trainscg, traincgp, trainoss, trainbfg
| Provide feedback about this page |
![]() | traincgb | traincgp | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |