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

详细描述

The first order cost function base class.

This class gives the interface used in a first-order gradient-based unconstrained minimizer

For example: least square cost function \(f(w)\)

\[ f(w)=\sum_i{(y_i-w^T x_i)^2} \]

where \(w\) is target variable, \(x_i\) is features of the i-th sample, and \(y_i\) is the lable of the i-th sample.

在文件 FirstOrderCostFunction.h50 行定义.

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

Public 成员函数

virtual float64_t get_cost ()=0
 
virtual SGVector< float64_tobtain_variable_reference ()=0
 
virtual SGVector< float64_tget_gradient ()=0
 

成员函数说明

virtual float64_t get_cost ( )
pure virtual

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()

返回
cost

FirstOrderSAGCostFunction , 以及 FirstOrderStochasticCostFunction 内被实现.

virtual SGVector<float64_t> get_gradient ( )
pure virtual

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()

返回
gradient of variables

FirstOrderSAGCostFunction , 以及 FirstOrderStochasticCostFunction 内被实现.

virtual SGVector<float64_t> obtain_variable_reference ( )
pure virtual

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\)

返回
reference of variables

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

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