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
在文件 MomentumCorrection.h 第 46 行定义.
Public 成员函数 | |
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 属性 | |
SGVector< float64_t > | m_previous_descend_direction |
float64_t | m_weight |
在文件 MomentumCorrection.h 第 51 行定义.
|
virtual |
在文件 MomentumCorrection.h 第 58 行定义.
|
pure virtual |
Get corrected descend direction
negative_descend_direction | the negative descend direction |
idx | the index of the direction |
实现了 DescendCorrection.
在 AdaptMomentumCorrection, NesterovMomentumCorrection , 以及 StandardMomentumCorrection 内被实现.
|
virtual |
Get the length of the previous descend direction (velocity)
在文件 MomentumCorrection.h 第 143 行定义.
Get the previous descend direction (velocity) given the index
idx | index of the previous descend direction |
在文件 MomentumCorrection.h 第 132 行定义.
|
virtual |
Initialize m_previous_descend_direction?
被 AdaptMomentumCorrection 重载.
在文件 MomentumCorrection.h 第 73 行定义.
|
virtual |
Is the m_previous_descend_direction initialized?
被 AdaptMomentumCorrection 重载.
在文件 MomentumCorrection.h 第 64 行定义.
|
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 |
实现了 DescendCorrection.
被 AdaptMomentumCorrection 重载.
在文件 MomentumCorrection.h 第 116 行定义.
|
virtualinherited |
Set the weight used in descend correction
param weight the weight
被 AdaptMomentumCorrection 重载.
在文件 DescendCorrection.h 第 74 行定义.
|
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 |
实现了 DescendCorrection.
被 AdaptMomentumCorrection 重载.
在文件 MomentumCorrection.h 第 98 行定义.
used in momentum methods
在文件 MomentumCorrection.h 第 149 行定义.
|
protectedinherited |
weight of correction
在文件 DescendCorrection.h 第 110 行定义.