Neural Network Toolbox |
Resilient Backpropagation (trainrp)
Multilayer networks typically use sigmoid transfer functions in the hidden layers. These functions are often called "squashing" functions, since they compress an infinite input range into a finite output range. Sigmoid functions are characterized by the fact that their slope must approach zero as the input gets large. This causes a problem when using steepest descent to train a multilayer network with sigmoid functions, since the gradient can have a very small magnitude; and therefore, cause small changes in the weights and biases, even though the weights and biases are far from their optimal values.
The purpose of the resilient backpropagation (Rprop) training algorithm is to eliminate these harmful effects of the magnitudes of the partial derivatives. Only the sign of the derivative is used to determine the direction of the weight update; the magnitude of the derivative has no effect on the weight update. The size of the weight change is determined by a separate update value. The update value for each weight and bias is increased by a factor delt_inc
whenever the derivative of the performance function with respect to that weight has the same sign for two successive iterations. The update value is decreased by a factor delt_dec
whenever the derivative with respect that weight changes sign from the previous iteration. If the derivative is zero, then the update value remains the same. Whenever the weights are oscillating the weight change will be reduced. If the weight continues to change in the same direction for several iterations, then the magnitude of the weight change will be increased. A complete description of the Rprop algorithm is given in [ReBr93].
In the following code we recreate our previous network and train it using the Rprop algorithm. The training parameters for trainrp
are epochs
, show
, goal
, time
, min_grad
, max_fail
, delt_inc
, delt_dec
, delta0
, deltamax
. We have previously discussed the first eight parameters. The last two are the initial step size and the maximum step size, respectively. The performance of Rprop is not very sensitive to the settings of the training parameters. For the example below, we leave most of the training parameters at the default values. We do reduce show
below our previous value, because Rprop generally converges much faster than the previous algorithms.
p = [-1 -1 2 2;0 5 0 5]; t = [-1 -1 1 1]; net=newff(minmax(p),[3,1],{'tansig','purelin'},'trainrp'); net.trainParam.show = 10; net.trainParam.epochs = 300; net.trainParam.goal = 1e-5; [net,tr]=train(net,p,t); TRAINRP, Epoch 0/300, MSE 0.469151/1e-05, Gradient 1.4258/1e-06 TRAINRP, Epoch 10/300, MSE 0.000789506/1e-05, Gradient 0.0554529/1e-06 TRAINRP, Epoch 20/300, MSE 7.13065e-06/1e-05, Gradient 0.00346986/1e-06 TRAINRP, Performance goal met. a = sim(net,p) a = -1.0026 -0.9963 0.9978 1.0017
Rprop is generally much faster than the standard steepest descent algorithm. It also has the nice property that it requires only a modest increase in memory requirements. We do need to store the update values for each weight and bias, which is equivalent to storage of the gradient.
Variable Learning Rate (traingda, traingdx) | Conjugate Gradient Algorithms |
© 1994-2005 The MathWorks, Inc.