| Neural Network Toolbox | |
| Provide feedback about this page |
Batch training with weight and bias learning rules
Syntax
Description
trainb is not called directly. Instead it is called by train for networks whose net.trainFcn property is set to 'trainb'.
trainb trains a network with weight and bias learning rules with batch updates. The weights and biases are updated at the end of an entire pass through the input data.
trainb(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 |
Initial input conditions |
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 trainb's training parameters, shown here with their default values:
trainb('info') returns useful information about this function.
Network Use
You can create a standard network that uses trainb by calling newlin.
To prepare a custom network to be trained with trainb,
net.trainFcn to 'trainb'. This sets net.trainParam to trainb's default parameters.
net.inputWeights{i,j}.learnFcn to a learning function. Set each net.layerWeights{i,j}.learnFcn to a learning function. Set each net.biases{i}.learnFcn to a learning function. (Weight and bias learning parameters are automatically set to default values for the given learning function.)
net.trainParam properties to desired values.
train.
See newlin for training examples.
Algorithm
Each weight and bias is updated according to its learning function after each epoch (one pass through the entire set of input vectors).
Training stops when any of these conditions is met:
epochs (repetitions) is reached.
goal.
time is exceeded.
max_fail times since the last time it decreased (when using validation).
See Also
| Provide feedback about this page |
![]() | train | trainbfg | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |