SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
List of all members | Public Member Functions
L2Penalty Class Reference

Detailed Description

The class implements L2 penalty/regularization within the FirstOrderMinimizer framework.

For L2 penalty, \(L2(w)\)

\[ L2(w)=\frac{w^t w}{2} \]

Definition at line 46 of file L2Penalty.h.

Inheritance diagram for L2Penalty:
Inheritance graph
[legend]

Public Member Functions

 L2Penalty ()
 
virtual ~L2Penalty ()
 
virtual float64_t get_penalty (float64_t variable)
 
virtual float64_t get_penalty_gradient (float64_t variable, float64_t gradient_of_variable)
 
virtual void update_context (CMinimizerContext *context)
 
virtual void load_from_context (CMinimizerContext *context)
 

Constructor & Destructor Documentation

L2Penalty ( )

Definition at line 50 of file L2Penalty.h.

virtual ~L2Penalty ( )
virtual

Definition at line 53 of file L2Penalty.h.

Member Function Documentation

virtual float64_t get_penalty ( float64_t  variable)
virtual

Given the value of a target variable, this method returns the penalty of the variable

Parameters
variablevalue of the variable
Returns
penalty of the variable

Implements Penalty.

Definition at line 61 of file L2Penalty.h.

virtual float64_t get_penalty_gradient ( float64_t  variable,
float64_t  gradient_of_variable 
)
virtual

Return the gradient of the penalty wrt a target variable Note that the penalized gradient=unpenalized gradient+penalty_gradient

For L2 penalty

\[ \frac{\partial L2(w) }{\partial w}=w \]

Parameters
variablevalue of a target variable
gradient_of_variableunregularized/unpenalized gradient of the variable
Returns
the gradient of the penalty wrt the variable

Implements Penalty.

Definition at line 75 of file L2Penalty.h.

virtual void load_from_context ( CMinimizerContext context)
virtual

Load the given context object to restore mutable variables

Parameters
contexta context object

Implements Penalty.

Definition at line 92 of file L2Penalty.h.

virtual void update_context ( CMinimizerContext context)
virtual

Update a context object to store mutable variables used in learning rate

Parameters
contexta context object

Implements Penalty.

Definition at line 83 of file L2Penalty.h.


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

SHOGUN Machine Learning Toolbox - Documentation