Neural Network Toolbox
  Go to function:
    Search    Help Desk 
trainlm    See Also

Levenberg-Marquardt backpropagation

Syntax

Description

trainlm is a network training function that updates weight and bias values according to Levenberg-Marquardt optimization.

trainlm(net,Pd,Tl,Ai,Q,TS,VV) takes these inputs,

and returns,

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

Dimensions for these variables are:

where

If VV is not [], it must be a structure of validation vectors,

which is 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.

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

Network Use

You can create a standard network that uses trainlm with newff, newcf, or newelm.

To prepare a custom network to be trained with trainlm:

   1.
Set net.trainFcn to 'trainlm'. This will set net.trainParam to trainlm's default parameters.
   2.
Set net.trainParam properties to desired values.
In either case, calling train with the resulting network will train the network with trainlm.

See newff, newcf, and newelm for examples.

Algorithm

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

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 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 training times.

Training stops when any of these conditions occur:

   1.
The maximum number of epochs (repetitions) is reached.
   2.
The maximum amount of time has been exceeded.
   3.
Performance has been minimized to the goal.
   4.
The performance gradient falls below mingrad.
   5.
mu exceeds mu_max.
   6.
Validation performance has increase more than max_fail times since the last time it decreased (when using validation).

See Also



[ Previous | Help Desk | Next ]