trainr
Random order incremental training with learning functions
Syntax
net.trainFcn = 'trainr'
[net,tr] = train(net,...)
Description
trainr
is not called directly. Instead it is called by
train
for networks whose net.trainFcn
property is set to
'trainr'
, thus:
net.trainFcn = 'trainr'
sets the network trainFcn
property.
[net,tr] = train(net,...)
trains the network with
trainr
.
trainr
trains a network with weight and bias learning rules with
incremental updates after each presentation of an input. Inputs are presented in random
order.
Training occurs according to trainr
training parameters, shown here with
their default values:
net.trainParam.epochs | 1000 | Maximum number of epochs to train |
net.trainParam.goal | 0 | Performance goal |
net.trainParam.max_fail | 6 | Maximum validation failures |
net.trainParam.show | 25 | Epochs between displays ( |
net.trainParam.showCommandLine | false | Generate command-line output |
net.trainParam.showWindow | true | Show training GUI |
net.trainParam.time | inf | Maximum time to train in seconds |
Network Use
You can create a standard network that uses trainr
by calling
competlayer
or selforgmap
. To prepare a custom network to
be trained with trainr
,
Set
net.trainFcn
to'trainr'
. This setsnet.trainParam
totrainr
’s default parameters.Set each
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.)
To train the network,
Set
net.trainParam
properties to desired values.Set weight and bias learning parameters to desired values.
Call
train
.
See help competlayer
and help selforgmap
for training
examples.
Algorithms
For each epoch, all training vectors (or sequences) are each presented once in a different random order, with the network and weight and bias values updated accordingly after each individual presentation.
Training stops when any of these conditions is met:
The maximum number of
epochs
(repetitions) is reached.Performance is minimized to the
goal
.The maximum amount of
time
is exceeded.
Version History
Introduced before R2006a