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

详细描述

The base class for sparse penalty/regularization used in minimization.

This is the interface of regularizers used in minimizers. (eg, FirstOrderMinimizer::update_gradient(SGVector<float64_t> gradient, SGVector<float64_t> var) FirstOrderMinimizer::get_penalty(SGVector<float64_t> var) )

在文件 SparsePenalty.h46 行定义.

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

Public 成员函数

virtual float64_t get_sparse_variable (float64_t variable, float64_t penalty_weight)=0
 
virtual void update_variable_for_proximity (SGVector< float64_t > variable, float64_t proximal_weight)=0
 
virtual float64_t get_penalty (float64_t variable)=0
 
virtual float64_t get_penalty_gradient (float64_t variable, float64_t gradient)=0
 
virtual void update_context (CMinimizerContext *context)=0
 
virtual void load_from_context (CMinimizerContext *context)=0
 

成员函数说明

virtual float64_t get_penalty ( float64_t  variable)
pure virtualinherited

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

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

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

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

ElasticNetPenalty, L1Penalty , 以及 L2Penalty 内被实现.

virtual float64_t get_penalty_gradient ( float64_t  variable,
float64_t  gradient 
)
pure virtualinherited

Returns 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 \]

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

ElasticNetPenalty, L1Penalty , 以及 L2Penalty 内被实现.

virtual float64_t get_sparse_variable ( float64_t  variable,
float64_t  penalty_weight 
)
pure virtual

Get the sparse variable

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

ElasticNetPenalty , 以及 L1Penalty 内被实现.

virtual void load_from_context ( CMinimizerContext context)
pure virtualinherited

Load the given context object to restore mutable variables

参数
contexta context object

ElasticNetPenalty, L1Penalty, L1PenaltyForTG , 以及 L2Penalty 内被实现.

virtual void update_context ( CMinimizerContext context)
pure virtualinherited

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

参数
contexta context object

ElasticNetPenalty, L1Penalty, L1PenaltyForTG , 以及 L2Penalty 内被实现.

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

Do proximal projection/operation in place

参数
variablethe raw variable
proximal_weightweight of the penalty

ElasticNetPenalty, L1Penalty , 以及 L1PenaltyForTG 内被实现.


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

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