| Neural Network Toolbox | |
| Provide feedback about this page |
One-step secant backpropagation
Syntax
Description
trainoss is a network training function that updates weight and bias values according to the one-step secant method.
trainoss(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 trainoss's training parameters, shown here with their default values:
Parameters related to line search methods (not all used for all methods):
trainoss('info') returns useful information about this function.
Network Use
You can create a standard network that uses trainoss with newff, newcf, or newelm. To prepare a custom network to be trained with trainoss,
net.trainFcn to 'trainoss'. This sets net.trainParam to trainoss's default parameters.
net.trainParam properties to desired values.
In either case, calling train with the resulting network trains the network with trainoss.
Examples
Here is a problem consisting of inputs p and targets t to be solved with a network.
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 trainoss network training function is to be used.
Here the network is trained and retested.
net.trainParam.epochs = 50; net.trainParam.show = 10; net.trainParam.goal = 0.1; net = train(net,p,t); a = sim(net,p)
Algorithm
trainoss 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 steps and gradients, according to the following formula:
where gX is the gradient, X_step is the change in the weights on the previous iteration, and dgX is the change in the gradient from the last iteration. See Battiti (Neural Computation, Vol. 4, 1992, pp. 141-166) for a more detailed discussion of the one-step secant 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
Battiti, R., "First and second order methods for learning: Between steepest descent and Newton's method," Neural Computation, Vol. 4, No. 2, 1992, pp. 141-166
See Also
newff, newcf, traingdm, traingda, traingdx, trainlm, trainrp, traincgf, traincgb, trainscg, traincgp, trainbfg
| Provide feedback about this page |
![]() | trainlm | trainr | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |