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

Gradient descent with momentum and adaptive learning rate backpropagation

Syntax

Description

traingdx is a network training function that updates weight and bias values according to gradient descent momentum and an adaptive learning rate.

traingdx(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
NoxTS 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 traingdx's training parameters, shown here with their default values:

net.trainParam.epochs
10

Maximum number of epochs to train
net.trainParam.goal
0

Performance goal
net.trainParam.lr
0.01

Learning rate
net.trainParam.lr_inc
1.05

Ratio to increase learning rate
net.trainParam.lr_dec
0.7

Ratio to decrease learning rate
net.trainParam.max_fail
5

Maximum validation failures
net.trainParam.max_perf_inc
1.04

Maximum performance increase
net.trainParam.mc
0.9

Momentum constant
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

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

Network Use

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

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

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

See newff, newcf, and newelm for examples.

Algorithm

traingdx 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 gradient descent with momentum,

where dXprev is the previous change to the weight or bias.

For each epoch, if performance decreases toward the goal, then the learning rate is increased by the factor lr_inc. If performance increases by more than the factor max_perf_inc, the learning rate is adjusted by the factor lr_dec and the change that increased the performance is not made.

Training stops when any of these conditions occurs:

See Also

newff, newcf, traingd, traingdm, traingda, trainlm


 Provide feedback about this page 

Previous page traingdm trainlm Next page

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