#include <Rprop.h>

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 , set to 1.2 by default. | |
| double | nm |
The decrease factor , set to 0.5 by default. | |
| double | dMax |
The upper limit of the increments , set to 1e100 by default. | |
| double | dMin |
The lower limit of the increments , 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. | |
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
for weight
in iteration
, where the parameter will be adapted before the change of the weights:

The parameters
and
control the speed of the adaptation. To stabilize the increments, they are restricted to the interval
.
After the adaptation of the
the update for the weights will be calculated as

Furthermore, weight-backtracking will take place to increase the stability of the method, i.e. if
then
, 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
Definition at line 142 of file Rprop.h.
| void RpropPlus::init | ( | Model & | model | ) | [inline, virtual] |
Initializes the optimizer with default parameters.
Initializes the optimizer's parameters with the following defaults:
| model | Model to be optimized. |
Implements Optimizer.
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.
| model | Model to be optimized. | |
| delta0P | Initial values for the parameters | |
| npP | The increase factor , set to 1.2 by default. | |
| nmP | The decrease factor , set to 0.5 by default. | |
| dMaxP | The upper limit of the increments , set to 1e100 by default. | |
| dMinP | The lower limit of the increments , set to 0.0 by default. |
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
is assigned to all weights of the network.
| model | Model to be optimized. | |
| npP | The increase factor , set to 1.2 by default. | |
| nmP | The decrease factor , set to 0.5 by default. | |
| dMaxP | The upper limit of the increments , set to 1e100 by default. | |
| dMinP | The lower limit of the increments , set to 0.0 by default. | |
| delta0P | Initial value for the parameter , set to 0.01 by default. |
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
of the used network for the current iteration
is calculated and the values of the weights
and the parameters
are adapted depending on this error.
| 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. |
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".
| x | The value of which the sign shall be determined. |
Definition at line 346 of file Rprop.h.
Referenced by optimize().
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
, 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
, 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
, 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
, set to 1.2 by default.
Definition at line 352 of file Rprop.h.
Referenced by initUserDefined(), and optimize().