Rprop optimiser — Resilient Backpropagation (Riedmiller & Braun 1993).
A magnitude-free quasi-Newton method: each parameter carries its own step size which grows when the gradient sign is consistent and shrinks when it flips. Because only enters the update, Rprop is immune to gradient-magnitude pathologies (vanishing or exploding) but is incompatible with mini-batch noise — it is a batch-mode method.
Math
Let be the per-parameter step size and the gradient.
When the sign flips, is additionally zeroed to suppress a secondary overshoot on the following step. The parameter update is
References
Riedmiller & Braun, "A Direct Adaptive Method for Faster Backpropagation Learning: The RPROP Algorithm" (ICNN 1993).
See Also
RMSprop — Hinton's mini-batch-friendly replacement that
still uses an EMA of but keeps the gradient magnitude in the
update.
Parameters
paramsvector of TensorImpllrfloat, default 1e-2step_size_. Despite the name this is not used as a global scale.eta_minusfloat, default 0.5eta_plusfloat, default 1.2step_minfloat, default 1e-6step_maxfloat, default 50.0Attributes
prev_grad_vector of Storagestep_size_vector of Storagelr_ on every element rather than to 1.0, so the very first update has a sensible scale.Notes
Rprop assumes deterministic gradients (full-batch). Applying it to mini-batches confuses sign-flip detection because batch noise causes spurious sign changes — accepted practice is to either use very large batches or switch to RMSprop.
Constructors
1Construct the optimiser and resize per-slot state vectors.
Parameters
paramsvector of TensorImpllrfloat, default 1e-2step_size_.eta_minusfloat, default 0.5eta_plusfloat, default 1.2step_minfloat, default 1e-6step_maxfloat, default 50.0Virtual methods
2Return the current lr_ parameter.
Returns
floatLatest value passed to set_lr (or the constructor).
Set the active learning-rate parameter.
Parameters
lrfloatlr_ value. This is not retroactively applied to existing step_size_ buffers — it only affects fresh allocations.Methods
3Allocate prev_grad_ and step_size_ for parameter i.
Parameters
iintNotes
prev_grad_[i] is zero-initialised; step_size_[i] is
filled with lr_ so the first step has a sensible magnitude.
Return the versioned state-dict identifier.
Returns
str"rprop_v1".
Apply one Rprop update to parameter i.
Parameters
iintgStoragep on this step. May be zeroed in place where the sign of g flipped relative to prev_grad_.Notes
Drives the per-element step-size adaptation rule above and then
applies to p.