Neural Network Toolbox Previous page   Next Page
trainb

Batch training with weight and bias learning rules.

Syntax

[net,TR,Ac,El] = trainb(net,Pd,Tl,Ai,Q,TS,VV,TV)

info = trainb(code)

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,Pd,Tl,Ai,Q,TS,VV,TV) takes these inputs,

and returns,

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

Dimensions for these variables are:

where

If VV or TV is not [], it must be a structure of vectors:

Validation vectors are used to stop training early if the network performance on the validation vectors fails to improve or remains the same for max_fail epochs in a row. Test vectors are used as a further check that the network is generalizing well, but do not have any effect on training.

trainb(CODE) returns useful information for each CODE string:

Network Use

    You can create a standard network that uses trainb by calling newlin.

To prepare a custom network to be trained with trainb

  1. Set net.trainFcn to 'trainb'.
  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 will automatically be 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 newlin for training examples

Algorithm

Each weight and bias updates according to its learning function after each epoch (one pass through the entire set of input vectors).

Training stops when any of these conditions are met:

See Also

newp, newlin, train


Previous page  train trainbfg Next page

© 1994-2005 The MathWorks, Inc.