SHOGUN
4.1.0
|
This implements the adaptive momentum correction method.
A standard momentum correction performs update based on a momentum (eg, \(\mu\)), a previous descend direction (eg, \(v\)) and a current descend direction (eg, \(d\)).
The idea of adaptive momentum correction method is If signs of the last two momentum corrections are different, the current descend direction is discounted On the other hand, if the the signs are the same, the method raises the current descend direction Please see method get_corrected_descend_direction() for details
Definition at line 50 of file AdaptMomentumCorrection.h.
Public Member Functions | |
AdaptMomentumCorrection () | |
virtual void | set_momentum_correction (MomentumCorrection *correction) |
virtual | ~AdaptMomentumCorrection () |
virtual bool | is_initialized () |
virtual void | set_correction_weight (float64_t weight) |
virtual void | initialize_previous_direction (index_t len) |
virtual DescendPair | get_corrected_descend_direction (float64_t negative_descend_direction, index_t idx) |
virtual void | update_context (CMinimizerContext *context) |
virtual void | load_from_context (CMinimizerContext *context) |
virtual void | set_adapt_rate (float64_t adapt_rate, float64_t rate_min=0.0, float64_t rate_max=CMath::INFTY) |
virtual void | set_init_descend_rate (float64_t init_descend_rate) |
virtual float64_t | get_previous_descend_direction (index_t idx) |
virtual float64_t | get_length_previous_descend_direction () |
Definition at line 55 of file AdaptMomentumCorrection.h.
|
virtual |
Definition at line 73 of file AdaptMomentumCorrection.h.
|
virtual |
Get corrected descend direction
negative_descend_direction | the negative descend direction |
idx | the index of the direction |
Implements MomentumCorrection.
Definition at line 111 of file AdaptMomentumCorrection.h.
|
virtualinherited |
Get the length of the previous descend direction (velocity)
Definition at line 143 of file MomentumCorrection.h.
Get the previous descend direction (velocity) given the index
idx | index of the previous descend direction |
Definition at line 132 of file MomentumCorrection.h.
|
virtual |
Initialize m_previous_descend_direction
Reimplemented from MomentumCorrection.
Definition at line 99 of file AdaptMomentumCorrection.h.
|
virtual |
Is the standard momentum method initialized?
Reimplemented from MomentumCorrection.
Definition at line 79 of file AdaptMomentumCorrection.h.
|
virtual |
Load the given context object to restore mutable variables
This method will be called by DescendUpdaterWithCorrection::load_from_context(CMinimizerContext* context)
context | a context object |
Reimplemented from MomentumCorrection.
Definition at line 173 of file AdaptMomentumCorrection.h.
|
virtual |
Set adaptive weights used in this method
adapt_rate | the rate is used to discount/raise the current descend direction (see get_corrected_descend_direction() ) |
rate_min | minimum of the rate |
rate_max | maximum of the rate |
Definition at line 191 of file AdaptMomentumCorrection.h.
|
virtual |
Set the weight (momentum) for the standard momentum method
weight | momentum |
Reimplemented from DescendCorrection.
Definition at line 89 of file AdaptMomentumCorrection.h.
|
virtual |
Set the init rate used to discount/raise the current descend direction
init_descend_rate | the init rate (default 1.0) |
Definition at line 206 of file AdaptMomentumCorrection.h.
|
virtual |
Set a standard momentum method
correction | standard momentum method (eg, StandardMomentumCorrection) |
Definition at line 65 of file AdaptMomentumCorrection.h.
|
virtual |
Update a context object to store mutable variables used in descend update
This method will be called by DescendUpdaterWithCorrection::update_context()
context | a context object |
Reimplemented from MomentumCorrection.
Definition at line 153 of file AdaptMomentumCorrection.h.
|
protected |
the adapt rate
Definition at line 217 of file AdaptMomentumCorrection.h.
element wise rate used to discount/raise the current descend direction
Definition at line 213 of file AdaptMomentumCorrection.h.
|
protected |
the init rate
Definition at line 223 of file AdaptMomentumCorrection.h.
|
protected |
the standard momentum method
Definition at line 215 of file AdaptMomentumCorrection.h.
used in momentum methods
Definition at line 149 of file MomentumCorrection.h.
|
protected |
the maximum of the adapt rate
Definition at line 221 of file AdaptMomentumCorrection.h.
|
protected |
the minimum of the adapt rate
Definition at line 219 of file AdaptMomentumCorrection.h.
|
protectedinherited |
weight of correction
Definition at line 110 of file DescendCorrection.h.