SHOGUN
4.1.0
|
This is a base class for momentum correction methods.
The interfact will be used in DescendUpdaterWithCorrection::update_variable().
An example of descend based correction is NesterovMomentumCorrection
Definition at line 46 of file MomentumCorrection.h.
Public Member Functions | |
MomentumCorrection () | |
virtual | ~MomentumCorrection () |
virtual bool | is_initialized () |
virtual void | initialize_previous_direction (index_t len) |
virtual DescendPair | get_corrected_descend_direction (float64_t negative_descend_direction, index_t idx)=0 |
virtual void | update_context (CMinimizerContext *context) |
virtual void | load_from_context (CMinimizerContext *context) |
virtual float64_t | get_previous_descend_direction (index_t idx) |
virtual float64_t | get_length_previous_descend_direction () |
virtual void | set_correction_weight (float64_t weight) |
Protected Attributes | |
SGVector< float64_t > | m_previous_descend_direction |
float64_t | m_weight |
Definition at line 51 of file MomentumCorrection.h.
|
virtual |
Definition at line 58 of file MomentumCorrection.h.
|
pure virtual |
Get corrected descend direction
negative_descend_direction | the negative descend direction |
idx | the index of the direction |
Implements DescendCorrection.
Implemented in AdaptMomentumCorrection, NesterovMomentumCorrection, and StandardMomentumCorrection.
|
virtual |
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 in AdaptMomentumCorrection.
Definition at line 73 of file MomentumCorrection.h.
|
virtual |
Is the m_previous_descend_direction initialized?
Reimplemented in AdaptMomentumCorrection.
Definition at line 64 of file MomentumCorrection.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 |
Implements DescendCorrection.
Reimplemented in AdaptMomentumCorrection.
Definition at line 116 of file MomentumCorrection.h.
|
virtualinherited |
Set the weight used in descend correction
param weight the weight
Reimplemented in AdaptMomentumCorrection.
Definition at line 74 of file DescendCorrection.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 |
Implements DescendCorrection.
Reimplemented in AdaptMomentumCorrection.
Definition at line 98 of file MomentumCorrection.h.
used in momentum methods
Definition at line 149 of file MomentumCorrection.h.
|
protectedinherited |
weight of correction
Definition at line 110 of file DescendCorrection.h.