Products & Services Solutions Academia Support User Community Company


trainbr

Purpose

Bayesian regulation backpropagation

Syntax

Description

trainbr is a network training function that updates the weight and bias values according to Levenberg-Marquardt optimization. It minimizes a combination of squared errors and weights, and then determines the correct combination so as to produce a network that generalizes well. The process is called Bayesian regularization.

trainbr(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
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 trainbr'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.mu
0.005

Marquardt adjustment parameter
net.trainParam.mu_dec
0.1

Decrease factor for mu
net.trainParam.mu_inc
10

Increase factor for mu
net.trainParam.mu_max
1e10

Maximum value for mu
net.trainParam.max_fail
5

Maximum validation failures
net.trainParam.mem_reduc
1

Factor to use for memory/speed tradeoff
net.trainParam.min_grad
1e-10

Minimum performance gradient
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

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

Network Use

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

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

In either case, calling train with the resulting network trains the network with trainbr. See newff, newcf, and newelm for examples.

Examples

Here is a problem consisting of inputs p and targets t to be solved with a network. It involves fitting a noisy sine wave.

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

Here the network is trained and tested.

Algorithm

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

Bayesian regularization minimizes a linear combination of squared errors and weights. It also modifies the linear combination so that at the end of training the resulting network has good generalization qualities. See MacKay (Neural Computation, Vol. 4, No. 3, 1992, pp. 415 to 447) and Foresee and Hagan (Proceedings of the International Joint Conference on Neural Networks, June, 1997) for more detailed discussions of Bayesian regularization.

This Bayesian regularization takes place within the Levenberg-Marquardt algorithm. Backpropagation is used to calculate the Jacobian jX of performance perf with respect to the weight and bias variables X. Each variable is adjusted according to Levenberg-Marquardt,

where E is all errors and I is the identity matrix.

The adaptive value mu is increased by mu_inc until the change shown above results in a reduced performance value. The change is then made to the network, and mu is decreased by mu_dec.

The parameter mem_reduc indicates how to use memory and speed to calculate the Jacobian jX. If mem_reduc is 1, then trainlm runs the fastest, but can require a lot of memory. Increasing mem_reduc to 2 cuts some of the memory required by a factor of two, but slows trainlm somewhat. Higher values continue to decrease the amount of memory needed and increase the training times.

Training stops when any of these conditions occurs:

References

MacKay, Neural Computation, Vol. 4, No. 3, 1992, pp. 415-447

Foresee and Hagan, Proceedings of the International Joint Conference on Neural Networks, June, 1997

See Also

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


 Provide feedback about this page 

Previous page trainbfgc trainbuwb Next page

Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

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