The class implements L2 penalty/regularization within the FirstOrderMinimizer framework.
For L2 penalty, \(L2(w)\)
\[ L2(w)=\frac{w^t w}{2} \]
在文件 L2Penalty.h 第 46 行定义.

Public 成员函数 | |
| 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) |
| L2Penalty | ( | ) |
在文件 L2Penalty.h 第 50 行定义.
|
virtual |
在文件 L2Penalty.h 第 53 行定义.
Given the value of a target variable, this method returns the penalty of the variable
| variable | value of the variable |
实现了 Penalty.
在文件 L2Penalty.h 第 61 行定义.
|
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 \]
| variable | value of a target variable |
| gradient_of_variable | unregularized/unpenalized gradient of the variable |
实现了 Penalty.
在文件 L2Penalty.h 第 75 行定义.
|
virtual |
Load the given context object to restore mutable variables
| context | a context object |
实现了 Penalty.
在文件 L2Penalty.h 第 92 行定义.
|
virtual |
Update a context object to store mutable variables used in learning rate
| context | a context object |
实现了 Penalty.
在文件 L2Penalty.h 第 83 行定义.