SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
所有成员列表 | Public 成员函数 | Protected 属性
L1PenaltyForTG类 参考

详细描述

The is the base class for L1 penalty/regularization within the FirstOrderMinimizer framework.

For L1 penalty, \(L1(w)\)

\[ L1(w)=\| w \|_1 = \sum_i \| w_i \| \]

This class implements the truncated gradient method.

Reference: Stochastic Gradient Descent Training for L1-regularized Log-linear Models with Cumulative Penalty

在文件 L1PenaltyForTG.h53 行定义.

类 L1PenaltyForTG 继承关系图:
Inheritance graph
[图例]

Public 成员函数

 L1PenaltyForTG ()
 
virtual ~L1PenaltyForTG ()
 
virtual void update_variable_for_proximity (SGVector< float64_t > variable, float64_t proximal_weight)
 
virtual void update_context (CMinimizerContext *context)
 
virtual void load_from_context (CMinimizerContext *context)
 
virtual float64_t get_penalty (float64_t variable)
 
virtual float64_t get_penalty_gradient (float64_t variable, float64_t gradient_of_variable)
 
virtual void set_rounding_epsilon (float64_t epsilon)
 
virtual float64_t get_sparse_variable (float64_t variable, float64_t penalty_weight)
 

Protected 属性

float64_t m_u
 
SGVector< float64_tm_q
 
float64_t m_rounding_epsilon
 

构造及析构函数说明

在文件 L1PenaltyForTG.h57 行定义.

virtual ~L1PenaltyForTG ( )
virtual

在文件 L1PenaltyForTG.h60 行定义.

成员函数说明

virtual float64_t get_penalty ( float64_t  variable)
virtualinherited

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

参数
variablevalue of the variable
返回
penalty of the variable

实现了 Penalty.

在文件 L1Penalty.h66 行定义.

virtual float64_t get_penalty_gradient ( float64_t  variable,
float64_t  gradient_of_variable 
)
virtualinherited

Return the gradient of the penalty wrt a target variable

Note that for L1 penalty we do not compute the gradient/sub-gradient in our implementation. Instead, we do a proximal projection.

参数
variablevalue of a target variable
gradient_of_variableunregularized/unpenalized gradient of the variable
返回
the gradient of the penalty wrt the variable

实现了 Penalty.

在文件 L1Penalty.h79 行定义.

virtual float64_t get_sparse_variable ( float64_t  variable,
float64_t  penalty_weight 
)
virtualinherited

Get the sparse variable

参数
variablethe raw variable
penalty_weightweight of the penalty
返回
sparse value of the variable

实现了 SparsePenalty.

在文件 L1Penalty.h128 行定义.

virtual void load_from_context ( CMinimizerContext context)
virtual

Load the given context object to restore mutable variables

参数
contexta context object

重载 L1Penalty .

在文件 L1PenaltyForTG.h115 行定义.

virtual void set_rounding_epsilon ( float64_t  epsilon)
virtualinherited

Set the rounding epsilon

参数
epsilonrounding epsilon

在文件 L1Penalty.h87 行定义.

virtual void update_context ( CMinimizerContext context)
virtual

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

参数
contexta context object

重载 L1Penalty .

在文件 L1PenaltyForTG.h96 行定义.

virtual void update_variable_for_proximity ( SGVector< float64_t variable,
float64_t  proximal_weight 
)
virtual

Do proximal projection/operation in place

参数
variablethe raw variable
proximal_weightweight of the penalty

重载 L1Penalty .

在文件 L1PenaltyForTG.h66 行定义.

类成员变量说明

SGVector<float64_t> m_q
protected

q is defined in Figure 2 of the reference

在文件 L1PenaltyForTG.h132 行定义.

float64_t m_rounding_epsilon
protectedinherited

rounding epsilon

在文件 L1Penalty.h148 行定义.

float64_t m_u
protected

u is defined in Figure 2 of the reference

在文件 L1PenaltyForTG.h130 行定义.


该类的文档由以下文件生成:

SHOGUN 机器学习工具包 - 项目文档