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

Sequential order incremental training with learning functions

Syntax

Description

trains is not called directly. Instead it is called by train for networks whose net.trainFcn property is set to 'trains'.

trains trains a network with weight and bias learning rules with sequential updates. The sequence of inputs is presented to the network with updates occurring after each time step.

This incremental training algorithm is commonly used for adaptive applications.

trains takes these inputs:

net
Neural network
Pd
Delayed inputs
Tl
Layer targets
Ai
Initial input conditions
Q
Batch size
TS
Time steps

and after training the network with its weight and bias learning functions returns

net
Updated network
TR
Training record:

TR.timesteps
Number of time steps

TR.perf
Performance for each time step
Ac
Collective layer outputs
El
Layer errors

Training occurs according to trains's training parameter, shown here with its default value:

net.trainParam.passes
1

Number of times to present sequence

Dimensions for these variables are

Pd
Nl x Ni x TS cell array
Each Pd{i,j,ts} is a Dij x Q matrix.
Tl
Nl x TS cell array
Each Tl{i,ts} is a Ui x Q matrix or [].
Ai
Nl x LD cell array
Each Ai{i,k} is an Si x Q matrix.
Ac
Nl x (LD+TS) cell array
Each Ac{i,k} is an Si x Q matrix.
El
Nl x TS cell array
Each El{i,k} is an Si x Q matrix or [].

where

Ni
=

net.numInputs
Nl
=

net.numLayers
LD
=

net.numLayerDelays
Ri
=

net.inputs{i}.size
Si
=

net.layers{i}.size
Ui
=

net.outputs{i}.size
Dij
=

Ri * length(net.inputWeights{i,j}.delays)

trains(code) returns useful information for each code string:

'pnames'
Names of training parameters
'pdefaults'
Default training parameters

Network Use

You can create a standard network that uses trains for adapting by calling newp or newlin.

To prepare a custom network to adapt with trains,

  1. Set net.adaptFcn to 'trains'. This sets net.adaptParam to trains's default parameters.
  2. 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 allow the network to adapt,

  1. Set weight and bias learning parameters to desired values.
  2. Call adapt.

See newp and newlin for adaption examples.

Algorithm

Each weight and bias is updated according to its learning function after each time step in the input sequence.

See Also

newp, newlin, train, trainb, trainc, trainr


 Provide feedback about this page 

Previous page trainrp trainscg Next page

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