RpropPlus Class Reference

This class offers methods for the usage of the Resilient-Backpropagation-algorithm with weight-backtracking. More...

#include <Rprop.h>

Inheritance diagram for RpropPlus:

Optimizer

List of all members.

Public Member Functions

void init (Model &model)
 Initializes the optimizer with default parameters.
void initUserDefined (Model &model, double npP=1.2, double nmP=0.5, double dMaxP=1e100, double dMinP=0.0, double delta0P=0.01)
 Prepares the Rprop algorithm for the given network.
void initUserDefined (Model &model, const Array< double > &delta0P, double npP=1.2, double nmP=0.5, double dMaxP=1e100, double dMinP=0.0)
 Rprop algorithm initialization.
double optimize (Model &model, ErrorFunction &errorfunction, const Array< double > &input, const Array< double > &target)
 Performs a run of the Rprop algorithm.

Protected Member Functions

int sgn (double x)
 Determines the sign of "x".

Protected Attributes

double np
 The increase factor $ \eta^+ $, set to 1.2 by default.
double nm
 The decrease factor $ \eta^- $, set to 0.5 by default.
double dMax
 The upper limit of the increments $ \Delta w_i^{(t)} $, set to 1e100 by default.
double dMin
 The lower limit of the increments $ \Delta w_i^{(t)} $, set to 0.0 by default.
Array< double > deltaw
 The final update values for all weights.
Array< double > dedwOld
 The last error gradient.
Array< double > delta
 The absolute update values (increment) for all weights.


Detailed Description

This class offers methods for the usage of the Resilient-Backpropagation-algorithm with weight-backtracking.

The Rprop algorithm is an improvement of the algorithms with adaptive learning rates (as the Adaptive Backpropagation algorithm by Silva and Ameida, please see AdpBP.h for a description of the working of such an algorithm), that uses increments for the update of the weights, that are independant from the absolute partial derivatives. This makes sense, because large flat regions in the search space (plateaus) lead to small absolute partial derivatives and so the increments are chosen small, but the increments should be large to skip the plateau. In contrast, the absolute partial derivatives are very large at the "slopes" of very "narrow canyons", which leads to large increments that will skip the minimum lying at the bottom of the canyon, but it would make more sense to chose small increments to hit the minimum.
So, the Rprop algorithm only uses the signs of the partial derivatives and not the absolute values to adapt the parameters.
Instead of individual learning rates, it uses the parameter $\Delta_i^{(t)}$ for weight $w_i,\ i = 1, \dots, n$ in iteration $t$, where the parameter will be adapted before the change of the weights:

$ \Delta_i^{(t)} = \Bigg\{ \begin{array}{ll} min( \eta^+ \cdot \Delta_i^{(t-1)}, \Delta_{max} ), & \mbox{if\ } \frac{\partial E^{(t-1)}}{\partial w_i} \cdot \frac{\partial E^{(t)}}{\partial w_i} > 0 \\ max( \eta^- \cdot \Delta_i^{(t-1)}, \Delta_{min} ), & \mbox{if\ } \frac{\partial E^{(t-1)}}{\partial w_i} \cdot \frac{\partial E^{(t)}}{\partial w_i} < 0 \\ \Delta_i^{(t-1)}, & \mbox{otherwise} \end{array} $

The parameters $\eta^+ > 1$ and $0 < \eta^- < 1$ control the speed of the adaptation. To stabilize the increments, they are restricted to the interval $[\Delta_{min}, \Delta_{max}]$.
After the adaptation of the $\Delta_i$ the update for the weights will be calculated as

$ \Delta w_i^{(t)} := - \mbox{sign} \left( \frac{\partial E^{(t)}}{\partial w_i}\right) \cdot \Delta_i^{(t)} $

Furthermore, weight-backtracking will take place to increase the stability of the method, i.e. if $\frac{\partial E^{(t-1)}}{\partial w_i} \cdot \frac{\partial E^{(t)}}{\partial w_i} < 0$ then $\Delta w_i^{(t)} := - \Delta w_i^{(t-1)}; \frac{\partial E^{(t)}}{\partial w_i} := 0$, where the assignment of zero to the partial derivative of the error leads to a freezing of the increment in the next iteration.

For further information about the algorithm, please refer to:

Martin Riedmiller and Heinrich Braun,
"A Direct Adaptive Method for Faster Backpropagation Learning: The RPROP Algorithm".
In "Proceedings of the IEEE International Conference on Neural Networks", pp. 586-591,
Published by IEEE Press in 1993

Author:
C. Igel
Date:
1999
Changes:
none
Status:
stable
Examples:

simpleMSERNNet.cpp.

Definition at line 142 of file Rprop.h.


Member Function Documentation

void RpropPlus::init ( Model model  )  [inline, virtual]

Initializes the optimizer with default parameters.

Initializes the optimizer's parameters with the following defaults:

  • Increase factor $\eta^+ = 1.2$
  • Decrease factor $\eta^- = 0.5$
  • Upper increment limit = 1e100
  • Lower increment limit = 0.0
  • Initial value for $\Delta = 0.01$

Parameters:
model Model to be optimized.
Returns:
None.
Author:
C. Igel
Date:
1999
Changes
none
Status
stable

Implements Optimizer.

Examples:
simpleMSERNNet.cpp.

Definition at line 172 of file Rprop.h.

References initUserDefined().

void RpropPlus::initUserDefined ( Model model,
const Array< double > &  delta0P,
double  npP = 1.2,
double  nmP = 0.5,
double  dMaxP = 1e100,
double  dMinP = 0.0 
) [inline]

Rprop algorithm initialization.

This initialization allows for the definition of user defined initial step widths for each coordinate individually.
Parameters:
model Model to be optimized.
delta0P Initial values for the parameters $\Delta$
npP The increase factor $\eta^+$, set to 1.2 by default.
nmP The decrease factor $\eta^-$, set to 0.5 by default.
dMaxP The upper limit of the increments $\Delta w_i^{(t)}$, set to 1e100 by default.
dMinP The lower limit of the increments $\Delta w_i^{(t)}$, set to 0.0 by default.
Returns:
none
Author:
T. Glasmachers
Date:
2006

Definition at line 244 of file Rprop.h.

References dedwOld, delta, deltaw, dMax, dMin, Model::getParameterDimension(), nm, and np.

void RpropPlus::initUserDefined ( Model model,
double  npP = 1.2,
double  nmP = 0.5,
double  dMaxP = 1e100,
double  dMinP = 0.0,
double  delta0P = 0.01 
) [inline]

Prepares the Rprop algorithm for the given network.

Internal variables of the class instance are initialized and memory for used structures adapted to the used network. An initial value for the parameter $\Delta$ is assigned to all weights of the network.

Parameters:
model Model to be optimized.
npP The increase factor $\eta^+$, set to 1.2 by default.
nmP The decrease factor $\eta^-$, set to 0.5 by default.
dMaxP The upper limit of the increments $\Delta w_i^{(t)}$, set to 1e100 by default.
dMinP The lower limit of the increments $\Delta w_i^{(t)}$, set to 0.0 by default.
delta0P Initial value for the parameter $\Delta$, set to 0.01 by default.
Returns:
none
Author:
C. Igel
Date:
1999
Changes
none
Status
stable

Definition at line 206 of file Rprop.h.

References dedwOld, delta, deltaw, dMax, dMin, Model::getParameterDimension(), nm, and np.

Referenced by init().

double RpropPlus::optimize ( Model model,
ErrorFunction errorfunction,
const Array< double > &  input,
const Array< double > &  target 
) [inline, virtual]

Performs a run of the Rprop algorithm.

The error $E^{(t)}$ of the used network for the current iteration $t$ is calculated and the values of the weights $w_i,\ i = 1, \dots, n$ and the parameters $\Delta_i$ are adapted depending on this error.

Parameters:
model Model to be optimized.
errorfunction Error function to be used for the optimization.
input Input vector for the model.
target Corresponding targets to the given inputs.
Returns:
The current error.
Author:
C. Igel
Date:
1999
Changes
none
Status
stable

Implements Optimizer.

Definition at line 286 of file Rprop.h.

References dedwOld, delta, deltaw, dMax, dMin, ErrorFunction::errorDerivative(), Model::getParameter(), Model::getParameterDimension(), i, Model::isFeasible(), nm, np, Model::setParameter(), and sgn().

int RpropPlus::sgn ( double  x  )  [inline, protected]

Determines the sign of "x".

Parameters:
x The value of which the sign shall be determined.
Returns:
"-1", if the sign of x is negative, "0" otherwise.
Author:
C. Igel
Date:
1999
Changes
none
Status
stable

Definition at line 346 of file Rprop.h.

Referenced by optimize().


Member Data Documentation

Array<double> RpropPlus::dedwOld [protected]

The last error gradient.

Definition at line 367 of file Rprop.h.

Referenced by initUserDefined(), and optimize().

Array<double> RpropPlus::delta [protected]

The absolute update values (increment) for all weights.

Definition at line 370 of file Rprop.h.

Referenced by initUserDefined(), and optimize().

Array<double> RpropPlus::deltaw [protected]

The final update values for all weights.

Definition at line 364 of file Rprop.h.

Referenced by initUserDefined(), and optimize().

double RpropPlus::dMax [protected]

The upper limit of the increments $ \Delta w_i^{(t)} $, set to 1e100 by default.

Definition at line 358 of file Rprop.h.

Referenced by initUserDefined(), and optimize().

double RpropPlus::dMin [protected]

The lower limit of the increments $ \Delta w_i^{(t)} $, set to 0.0 by default.

Definition at line 361 of file Rprop.h.

Referenced by initUserDefined(), and optimize().

double RpropPlus::nm [protected]

The decrease factor $ \eta^- $, set to 0.5 by default.

Definition at line 355 of file Rprop.h.

Referenced by initUserDefined(), and optimize().

double RpropPlus::np [protected]

The increase factor $ \eta^+ $, set to 1.2 by default.

Definition at line 352 of file Rprop.h.

Referenced by initUserDefined(), and optimize().


The documentation for this class was generated from the following file: