The class wraps the Shogun's C-style LBFGS minimizer.
在文件 LBFGSMinimizer.h 第 49 行定义.
Public 成员函数 | |
LBFGSMinimizer () | |
LBFGSMinimizer (FirstOrderCostFunction *fun) | |
virtual | ~LBFGSMinimizer () |
virtual float64_t | minimize () |
virtual bool | supports_batch_update () const |
virtual void | set_lbfgs_parameters (int m=100, int max_linesearch=1000, ELBFGSLineSearch linesearch=BACKTRACKING_STRONG_WOLFE, int max_iterations=1000, float64_t delta=0.0, int past=0, float64_t epsilon=1e-5, float64_t min_step=1e-20, float64_t max_step=1e+20, float64_t ftol=1e-4, float64_t wolfe=0.9, float64_t gtol=0.9, float64_t xtol=1e-16, float64_t orthantwise_c=0.0, int orthantwise_start=0, int orthantwise_end=1) |
virtual CMinimizerContext * | save_to_context () |
virtual void | load_from_context (CMinimizerContext *context) |
virtual void | set_cost_function (FirstOrderCostFunction *fun) |
virtual void | set_penalty_weight (float64_t penalty_weight) |
virtual void | set_penalty_type (Penalty *penalty_type) |
Protected 成员函数 | |
virtual void | init_minimization () |
virtual void | update_context (CMinimizerContext *context) |
virtual float64_t | get_penalty (SGVector< float64_t > var) |
virtual void | update_gradient (SGVector< float64_t > gradient, SGVector< float64_t > var) |
LBFGSMinimizer | ( | ) |
在文件 LBFGSMinimizer.cpp 第 37 行定义.
LBFGSMinimizer | ( | FirstOrderCostFunction * | fun | ) |
Constructor
fun | cost function (user have to manully delete the pointer) |
在文件 LBFGSMinimizer.cpp 第 47 行定义.
|
virtual |
在文件 LBFGSMinimizer.cpp 第 43 行定义.
Get the penalty given target variables For L2 penalty, the target variable is \(w\) and the value of penalty is \(\lambda \frac{w^t w}{2}\), where \(\lambda\) is the weight of penalty
var | the variable used in regularization |
在文件 FirstOrderMinimizer.h 第 164 行定义.
|
protectedvirtual |
Init before minimization
在文件 LBFGSMinimizer.cpp 第 94 行定义.
|
virtual |
Load the given context object to restores mutable variables Usually it is used in deserialization.
context | a context object |
重载 FirstOrderMinimizer .
在文件 LBFGSMinimizer.h 第 142 行定义.
|
virtual |
Do minimization and get the optimal value
实现了 FirstOrderMinimizer.
在文件 LBFGSMinimizer.cpp 第 101 行定义.
|
virtual |
Return a context object which stores mutable variables Usually it is used in serialization.
重载 FirstOrderMinimizer .
在文件 LBFGSMinimizer.h 第 135 行定义.
|
virtualinherited |
|
virtual |
set L-BFGS parameters For details please see shogun/optimization/lbfgs/lbfgs.h
m | The number of corrections to approximate the inverse hessian matrix. Default value is 100. |
max_linesearch | The maximum number of trials to do line search for each L-BFGS update. Default value is 1000. |
linesearch | The line search algorithm. Default value is using the backtracking with the strong Wolfe condition line search |
max_iterations | The maximum number of iterations for L-BFGS update. Default value is 1000. |
delta | Delta for convergence test based on the change of function value. Default value is 0. |
past | Distance for delta-based convergence test. Default value is 0. |
epsilon | Epsilon for convergence test based on the change of gradient. Default value is 1e-5 |
min_step | The minimum step of the line search. The default value is 1e-20 |
max_step | The maximum step of the line search. The default value is 1e+20 |
ftol | A parameter used in Armijo condition. Default value is 1e-4 |
wolfe | A parameter used in curvature condition. Default value is 0.9 |
gtol | A parameter used in Morethuente linesearch to control the accuracy. Default value is 0.9 |
xtol | The machine precision for floating-point values. Default value is 1e-16. |
orthantwise_c | Coeefficient for the L1 norm of variables. This parameter should be set to zero for standard minimization problems. Setting this parameter to a positive value activates Orthant-Wise Limited-memory Quasi-Newton (OWL-QN) method. Default value is 0. |
orthantwise_start | Start index for computing L1 norm of the variables. This parameter is valid only for OWL-QN method. Default value is 0. |
orthantwise_end | End index for computing L1 norm of the variables. Default value is 1. |
在文件 LBFGSMinimizer.cpp 第 58 行定义.
|
virtualinherited |
Set the type of penalty For example, L2 penalty
penalty_type | the type of penalty. If NULL is given, regularization is not enabled. |
在文件 FirstOrderMinimizer.h 第 137 行定义.
|
virtualinherited |
Set the weight of penalty
penalty_weight | the weight of penalty, which is positive |
在文件 FirstOrderMinimizer.h 第 126 行定义.
|
virtual |
Does minimizer support batch update?
实现了 FirstOrderMinimizer.
在文件 LBFGSMinimizer.h 第 73 行定义.
|
protectedvirtualinherited |
Update a context object to store mutable variables
context | a context object |
被 FirstOrderStochasticMinimizer, SMDMinimizer , 以及 SMIDASMinimizer 重载.
在文件 FirstOrderMinimizer.h 第 147 行定义.
|
protectedvirtualinherited |
Add gradient of the penalty wrt target variables to unpenalized gradient For least sqaure with L2 penalty,
\[ L2f(w)=f(w) + L2(w) \]
where \( f(w)=\sum_i{(y_i-w^T x_i)^2}\) is the least sqaure cost function and \(L2(w)=\lambda \frac{w^t w}{2}\) is the L2 penalty
Target variables is \(w\) Unpenalized gradient is \(\frac{\partial f(w) }{\partial w}\) Gradient of the penalty wrt target variables is \(\frac{\partial L2(w) }{\partial w}\)
gradient | unpenalized gradient wrt its target variable |
var | the target variable |
在文件 FirstOrderMinimizer.h 第 190 行定义.
|
protected |
Delta for convergence test based on the change of function value.
在文件 LBFGSMinimizer.h 第 174 行定义.
|
protected |
Epsilon for convergence test based on the change of gradient.
在文件 LBFGSMinimizer.h 第 180 行定义.
|
protected |
A parameter used in Armijo condition.
在文件 LBFGSMinimizer.h 第 189 行定义.
|
protectedinherited |
Cost function
在文件 FirstOrderMinimizer.h 第 205 行定义.
|
protected |
A parameter used in Morethuente linesearch to control the accuracy.
在文件 LBFGSMinimizer.h 第 195 行定义.
|
protected |
The line search algorithm.
在文件 LBFGSMinimizer.h 第 168 行定义.
|
protected |
The number of corrections to approximate the inverse hessian matrix.
在文件 LBFGSMinimizer.h 第 162 行定义.
|
protected |
The maximum number of iterations for L-BFGS update.
在文件 LBFGSMinimizer.h 第 171 行定义.
|
protected |
The maximum number of trials to do line search for each L-BFGS update.
在文件 LBFGSMinimizer.h 第 165 行定义.
|
protected |
The maximum step of the line search.
在文件 LBFGSMinimizer.h 第 186 行定义.
|
protected |
The minimum step of the line search.
在文件 LBFGSMinimizer.h 第 183 行定义.
|
protected |
Coeefficient for the L1 norm of variables.
在文件 LBFGSMinimizer.h 第 201 行定义.
|
protected |
End index for computing L1 norm of the variables.
在文件 LBFGSMinimizer.h 第 207 行定义.
|
protected |
Start index for computing L1 norm of the variables.
在文件 LBFGSMinimizer.h 第 204 行定义.
|
protected |
Distance for delta-based convergence test.
在文件 LBFGSMinimizer.h 第 177 行定义.
|
protectedinherited |
the type of penalty
在文件 FirstOrderMinimizer.h 第 208 行定义.
|
protectedinherited |
the weight of penalty
在文件 FirstOrderMinimizer.h 第 211 行定义.
Target variable
在文件 LBFGSMinimizer.h 第 210 行定义.
|
protected |
A parameter used in curvature condition.
在文件 LBFGSMinimizer.h 第 192 行定义.
|
protected |
The machine precision for floating-point values.
在文件 LBFGSMinimizer.h 第 198 行定义.