SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
List of all members | Public Member Functions | Protected Attributes
MomentumCorrection Class Referenceabstract

Detailed Description

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.

Inheritance diagram for MomentumCorrection:
Inheritance graph
[legend]

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_tm_previous_descend_direction
 
float64_t m_weight
 

Constructor & Destructor Documentation

Definition at line 51 of file MomentumCorrection.h.

virtual ~MomentumCorrection ( )
virtual

Definition at line 58 of file MomentumCorrection.h.

Member Function Documentation

virtual DescendPair get_corrected_descend_direction ( float64_t  negative_descend_direction,
index_t  idx 
)
pure virtual

Get corrected descend direction

Parameters
negative_descend_directionthe negative descend direction
idxthe index of the direction
Returns
DescendPair (corrected descend direction and the change to correct descend direction)

Implements DescendCorrection.

Implemented in AdaptMomentumCorrection, NesterovMomentumCorrection, and StandardMomentumCorrection.

virtual float64_t get_length_previous_descend_direction ( )
virtual

Get the length of the previous descend direction (velocity)

Returns
the length of the previous descend direction

Definition at line 143 of file MomentumCorrection.h.

virtual float64_t get_previous_descend_direction ( index_t  idx)
virtual

Get the previous descend direction (velocity) given the index

Parameters
idxindex of the previous descend direction
Returns
the previous descend direction

Definition at line 132 of file MomentumCorrection.h.

virtual void initialize_previous_direction ( index_t  len)
virtual

Initialize m_previous_descend_direction?

Returns
len the length of m_previous_descend_direction to be initialized

Reimplemented in AdaptMomentumCorrection.

Definition at line 73 of file MomentumCorrection.h.

virtual bool is_initialized ( )
virtual

Is the m_previous_descend_direction initialized?

Returns
whether m_previous_descend_direction is initialized

Reimplemented in AdaptMomentumCorrection.

Definition at line 64 of file MomentumCorrection.h.

virtual void load_from_context ( CMinimizerContext context)
virtual

Load the given context object to restore mutable variables

This method will be called by DescendUpdaterWithCorrection::load_from_context(CMinimizerContext* context)

Parameters
contexta context object

Implements DescendCorrection.

Reimplemented in AdaptMomentumCorrection.

Definition at line 116 of file MomentumCorrection.h.

virtual void set_correction_weight ( float64_t  weight)
virtualinherited

Set the weight used in descend correction

param weight the weight

Reimplemented in AdaptMomentumCorrection.

Definition at line 74 of file DescendCorrection.h.

virtual void update_context ( CMinimizerContext context)
virtual

Update a context object to store mutable variables used in descend update

This method will be called by DescendUpdaterWithCorrection::update_context()

Parameters
contexta context object

Implements DescendCorrection.

Reimplemented in AdaptMomentumCorrection.

Definition at line 98 of file MomentumCorrection.h.

Member Data Documentation

SGVector<float64_t> m_previous_descend_direction
protected

used in momentum methods

Definition at line 149 of file MomentumCorrection.h.

float64_t m_weight
protectedinherited

weight of correction

Definition at line 110 of file DescendCorrection.h.


The documentation for this class was generated from the following file:

SHOGUN Machine Learning Toolbox - Documentation