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

BFGS quasi-Newton backpropagation

Syntax

Description

trainbfg is a network training function that updates weight and bias values according to the BFGS quasi-Newton method.

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

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
No x TS 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 trainbfg's training parameters, shown here with their default values:

net.trainParam.epochs
100

Maximum number of epochs to train
net.trainParam.showWindow
25

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

Generate command-line output
net.trainParam.showGUI
1

Show training GUI
net.trainParam.goal
0

Performance goal
net.trainParam.time
inf

Maximum time to train in seconds
net.trainParam.min_grad
1e-6

Minimum performance gradient
net.trainParam.max_fail
5

Maximum validation failures
net.trainParam.searchFcn
'srchcha'

Name of line search routine to use

Parameters related to line search methods (not all used for all methods):

net.trainParam.scal_tol
20

Divide into delta to determine tolerance for linear search.
net.trainParam.alpha
0.001

Scale factor that determines sufficient reduction in perf
net.trainParam.beta
0.1

Scale factor that determines sufficiently large step size
net.trainParam.delta
0.01

Initial step size in interval location step
net.trainParam.gama
0.1

Parameter to avoid small reductions in performance, usually set to 0.1 (see srch_cha)
net.trainParam.low_lim
0.1

Lower limit on change in step size
net.trainParam.up_lim
0.5

Upper limit on change in step size
net.trainParam.maxstep
100

Maximum step length
net.trainParam.minstep
1.0e-6

Minimum step length
net.trainParam.bmax
26

Maximum step size
net.trainParam.batch_frag
0

In case of multiple batches, they are considered independent. Any nonzero value implies a fragmented batch, so the final layer's conditions of a previous trained epoch are used as initial conditions for the next epoch.

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

Network Use

You can create a standard network that uses trainbfg with newff, newcf, or newelm. To prepare a custom network to be trained with trainbfg,

  1. Set NET.trainFcn to 'trainbfg'. This sets NET.trainParam to trainbfg's default parameters.
  2. Set NET.trainParam properties to desired values.

In either case, calling train with the resulting network trains the network with trainbfg.

Examples

Here is a problem consisting of inputs P and targets T to be solved with a network.

Here a feed-forward network is created with one hidden layer of 2 neurons.

Here the network is trained and tested.

Algorithm

trainbfg can train any network as long as its weight, net input, and transfer functions have derivative functions.

Backpropagation is used to calculate derivatives of performance perf with respect to the weight and bias variables X. Each variable is adjusted according to the following:

where dX is the search direction. The parameter a is selected to minimize the performance along the search direction. The line search function searchFcn is used to locate the minimum point. The first search direction is the negative of the gradient of performance. In succeeding iterations the search direction is computed according to the following formula:

where gX is the gradient and H is a approximate Hessian matrix. See page 119 of Gill, Murray, and Wright (Practical Optimization, 1981) for a more detailed discussion of the BFGS quasi-Newton method.

Training stops when any of these conditions occurs:

Reference

Gill, Murray, & Wright, Practical Optimization, 1981

See Also

newff, newcf, traingdm, traingda, traingdx, trainlm, trainrp, traincgf, traincgb, trainscg, traincgp, trainoss


 Provide feedback about this page 

Previous page trainb trainbfgc Next page

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