Neural Network Toolbox™ Previous page   Next Page 
trainr
 Provide feedback about this page

Random order incremental training with learning functions

Syntax

Description

trainr is not called directly. Instead it is called by train for networks whose net.trainFcn property is set to '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.

trainr(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

and returns

net
Trained network
TR
Training record of various values over each epoch

Each argument trainV, valV, and testV is a structure of these fields:

X
N x TS cell array of inputs for N inputs and TS time steps. X{i,ts} is an Ri x Q matrix for the ith input and TS time step.
Xi
N x Nid cell array of input delay states for N inputs and Nid delays. Xi{i,j} is an Ri x Q matrix for the ith input and jth state.
Pd
N x S x Nid cell array of delayed input states.
T
NoxTS cell array of targets for No outputs and TS time steps. T{i,ts} is an Si x Q matrix for the ith output and TS time step.
Tl
Nl x TS cell array of targets for Nl layers and TS time steps. Tl{i,ts} is an Si x Q matrix for the ith layer and TS time step.
Ai
Nl x TS cell array of layer delays states for Nl layers, TS time steps. Ai{i,j} is an Si x Q matrix of delayed outputs for layer i, delay j.

Training occurs according to trainr's training parameters, shown here with their default values:

net.trainParam.epochs
100

Maximum number of epochs to train
net.trainParam.goal
0

Performance goal
net.trainParam.show
25

Epochs between displays (NaN for no displays)
net.trainParam.showCommandLine
0

Generate command-line output
net.trainParam.showWindow
1

Show training GUI
net.trainParam.time
inf

Maximum time to train in seconds

trainr('info') returns useful information about this function.

Network Use

You can create a standard network that uses trainr by calling newc or newsom. To prepare a custom network to be trained with trainr,

  1. Set net.trainFcn to 'trainr'. This sets net.trainParam to trainr's default parameters.
  2. Set each net.inputWeights{i,j}.learnFcn to a learning function.
  3. Set each net.layerWeights{i,j}.learnFcn to a learning function.
  4. 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,

  1. Set net.trainParam properties to desired values.
  2. Set weight and bias learning parameters to desired values.
  3. Call train.

See newc and newsom for training examples.

Algorithm

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:

See Also

newp, newlin, train


 Provide feedback about this page 

Previous page trainoss trainrp Next page

 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS