The first order cost function base class with bound constrains.
This class gives the interface used in a first-order gradient-based bound constrained minimizer
在文件 FirstOrderBoundConstraintsCostFunction.h 第 45 行定义.
Public 成员函数 | |
virtual SGVector< float64_t > | get_lower_bound ()=0 |
virtual SGVector< float64_t > | get_upper_bound ()=0 |
virtual float64_t | get_cost ()=0 |
virtual SGVector< float64_t > | obtain_variable_reference ()=0 |
virtual SGVector< float64_t > | get_gradient ()=0 |
|
pure virtualinherited |
Get the cost given current target variables
For least square, that is the value of \(f(w)\) given \(w\) is known
This method will be called by FirstOrderMinimizer::minimize()
在 FirstOrderSAGCostFunction , 以及 FirstOrderStochasticCostFunction 内被实现.
Get the gradient value wrt target variables
For least squares, that is the value of \(\frac{\partial f(w) }{\partial w}\) given \(w\) is known
This method will be called by FirstOrderMinimizer::minimize()
在 FirstOrderSAGCostFunction , 以及 FirstOrderStochasticCostFunction 内被实现.
Get the lower bound of variables
Usually the length of the bound should equal to the length of target variables.
If the length of the bound is 1, the bound constrain is applied to all target variables.
Get the upper bound of variables
Usually the length of the bound should equal to the length of target variables.
If the length of the bound is 1, the bound constrain is applied to all target variables.
Obtain a reference of target variables Minimizers will modify target variables in place.
This method will be called by FirstOrderMinimizer::minimize()
For least squares, that is \(w\)