TRF Language Model
wb::Func Class Referenceabstract

the objective function, used to derive More...

#include <wb-solve.h>

Inheritance diagram for wb::Func:
hrf::MLfunc trf::MLfunc hrf::SAfunc trf::SAfunc

Public Member Functions

 Func (int nParamNum=0)
 
void SetParamNum (int n)
 setting the parameter number More...
 
int GetParamNum () const
 get the paremeter number More...
 
virtual void SetParam (double *pdParams)=0
 set the parameter. More...
 
virtual double GetValue ()=0
 calculate the function value f(x) More...
 
virtual void GetGradient (double *pdGradient)=0
 calculate the gradient g(x) More...
 
virtual int GetExtraValues (int k, double *pdValues)
 calculate extra values which will be print at each iteration More...
 

Static Public Attributes

static const int cn_exvalue_max_num = 100
 

Protected Attributes

Solvem_pSolve
 Save the solve pointor. More...
 
int m_nParamNum
 the parameter number More...
 

Friends

class Solve
 
class LBFGS
 

Detailed Description

the objective function, used to derive

Author
wangbin
Date
2016-03-04

Definition at line 39 of file wb-solve.h.

Constructor & Destructor Documentation

§ Func()

wb::Func::Func ( int  nParamNum = 0)
inline

Definition at line 48 of file wb-solve.h.

Member Function Documentation

§ GetExtraValues()

virtual int wb::Func::GetExtraValues ( int  k,
double *  pdValues 
)
inlinevirtual

calculate extra values which will be print at each iteration

Parameters
[in]kiteration number form 1 to ...
[out]pdValuesReturn the values needed to be outputed. The memory is allocated outside and the maximum size = cn_exvalue_max_num
Returns
return the pdValues number

Reimplemented in hrf::SAfunc, trf::SAfunc, trf::MLfunc, and hrf::MLfunc.

Definition at line 66 of file wb-solve.h.

§ GetGradient()

virtual void wb::Func::GetGradient ( double *  pdGradient)
pure virtual

calculate the gradient g(x)

Implemented in hrf::SAfunc, trf::SAfunc, trf::MLfunc, and hrf::MLfunc.

§ GetParamNum()

int wb::Func::GetParamNum ( ) const
inline

get the paremeter number

Definition at line 52 of file wb-solve.h.

§ GetValue()

virtual double wb::Func::GetValue ( )
pure virtual

calculate the function value f(x)

Implemented in hrf::SAfunc, trf::SAfunc, trf::MLfunc, and hrf::MLfunc.

§ SetParam()

virtual void wb::Func::SetParam ( double *  pdParams)
pure virtual

set the parameter.

Implemented in hrf::SAfunc, trf::SAfunc, trf::MLfunc, and hrf::MLfunc.

§ SetParamNum()

void wb::Func::SetParamNum ( int  n)
inline

setting the parameter number

Definition at line 50 of file wb-solve.h.

Friends And Related Function Documentation

§ LBFGS

friend class LBFGS
friend

Definition at line 42 of file wb-solve.h.

§ Solve

friend class Solve
friend

Definition at line 41 of file wb-solve.h.

Member Data Documentation

§ cn_exvalue_max_num

const int wb::Func::cn_exvalue_max_num = 100
static

the maximu number of the values returned by GetExtrValues

Definition at line 59 of file wb-solve.h.

§ m_nParamNum

int wb::Func::m_nParamNum
protected

the parameter number

Definition at line 45 of file wb-solve.h.

§ m_pSolve

Solve* wb::Func::m_pSolve
protected

Save the solve pointor.

Definition at line 44 of file wb-solve.h.


The documentation for this class was generated from the following file: