SHOGUN
v1.1.0
|
MKLMultiClassGradient is a helper class for MKLMultiClass.
it solves the corresponding linear problem arising in SIP formulation for MKL using a gradient based approach
Definition at line 28 of file MKLMultiClassGradient.h.
Public Member Functions | |
MKLMultiClassGradient () | |
virtual | ~MKLMultiClassGradient () |
MKLMultiClassGradient (MKLMultiClassGradient &gl) | |
MKLMultiClassGradient | operator= (MKLMultiClassGradient &gl) |
virtual void | setup (const int32_t numkernels2) |
virtual void | addconstraint (const ::std::vector< float64_t > &normw2, const float64_t sumofpositivealphas) |
virtual void | computeweights (std::vector< float64_t > &weights2) |
virtual const char * | get_name () const |
virtual void | set_mkl_norm (float64_t norm) |
![]() | |
MKLMultiClassOptimizationBase () | |
virtual | ~MKLMultiClassOptimizationBase () |
![]() | |
CSGObject () | |
CSGObject (const CSGObject &orig) | |
virtual | ~CSGObject () |
virtual bool | is_generic (EPrimitiveType *generic) const |
template<class T > | |
void | set_generic () |
void | unset_generic () |
virtual void | print_serializable (const char *prefix="") |
virtual bool | save_serializable (CSerializableFile *file, const char *prefix="") |
virtual bool | load_serializable (CSerializableFile *file, const char *prefix="") |
void | set_global_io (SGIO *io) |
SGIO * | get_global_io () |
void | set_global_parallel (Parallel *parallel) |
Parallel * | get_global_parallel () |
void | set_global_version (Version *version) |
Version * | get_global_version () |
SGVector< char * > | get_modelsel_names () |
char * | get_modsel_param_descr (const char *param_name) |
index_t | get_modsel_param_index (const char *param_name) |
Protected Member Functions | |
void | genbetas (::std::vector< float64_t > &weights, const ::std::vector< float64_t > &gammas) |
void | gengammagradient (::std::vector< float64_t > &gammagradient, const ::std::vector< float64_t > &gammas, const int32_t dim) |
float64_t | objectives (const ::std::vector< float64_t > &weights, const int32_t index) |
void | linesearch (std::vector< float64_t > &finalbeta, const std::vector< float64_t > &oldweights) |
Protected Attributes | |
int32_t | numkernels |
::std::vector< ::std::vector < float64_t > > | normsofsubkernels |
::std::vector< float64_t > | sumsofalphas |
float64_t | pnorm |
Additional Inherited Members | |
![]() | |
SGIO * | io |
Parallel * | parallel |
Version * | version |
Parameter * | m_parameters |
Parameter * | m_model_selection_parameters |
Class default Constructor
Definition at line 15 of file MKLMultiClassGradient.cpp.
|
virtual |
Class default Destructor
Definition at line 21 of file MKLMultiClassGradient.cpp.
Class Copy Constructor
Definition at line 33 of file MKLMultiClassGradient.cpp.
|
virtual |
adds a constraint to the LP arising in L1 MKL based on two parameters
normw2 | is the vector of ![]() |
sumofpositivealphas | is a term depending on alphas, labels and biases, see in the function float64_t getsumofsignfreealphas() from MKLMultiClass.h, it depends on the formulation of the underlying GMNPSVM. |
Reimplemented from MKLMultiClassOptimizationBase.
Definition at line 60 of file MKLMultiClassGradient.cpp.
|
virtual |
computes MKL weights
weights2 | stores the new weights |
Reimplemented from MKLMultiClassOptimizationBase.
Definition at line 355 of file MKLMultiClassGradient.cpp.
|
protected |
helper routine for MKL optimization, computes form manifold coordinates the point on the manifold
gammas | - manifold coordinates |
weights | - the point on the manifold |
Definition at line 67 of file MKLMultiClassGradient.cpp.
|
protected |
helper routine for MKL optimization, computes greadient of manifold parametrization for one coordinate
gammagradient | - gradient |
gammas | - manifold coordinates |
dim | - the coordinate for which thegradient is to be computed |
Definition at line 98 of file MKLMultiClassGradient.cpp.
|
virtual |
Reimplemented from MKLMultiClassOptimizationBase.
Definition at line 77 of file MKLMultiClassGradient.h.
|
protected |
helper routine for MKL optimization, performs linesearch
finalbeta | |
oldweights |
Definition at line 154 of file MKLMultiClassGradient.cpp.
helper routine for MKL optimization, computes optimization objective for one contraint
weights | - MKL weights |
index | - index of constraint |
Definition at line 138 of file MKLMultiClassGradient.cpp.
MKLMultiClassGradient operator= | ( | MKLMultiClassGradient & | gl | ) |
Class Assignment operator
Definition at line 26 of file MKLMultiClassGradient.cpp.
|
virtual |
sets p-norm parameter for MKL
norm | the MKL norm |
Reimplemented from MKLMultiClassOptimizationBase.
Definition at line 52 of file MKLMultiClassGradient.cpp.
|
virtual |
initializes solver
numkernels2 | is the number of kernels |
Reimplemented from MKLMultiClassOptimizationBase.
Definition at line 40 of file MKLMultiClassGradient.cpp.
|
protected |
stores normsofsubkernels which is a constraint, normsofsubkernels[i] belongs to the i-th constraint
Definition at line 125 of file MKLMultiClassGradient.h.
|
protected |
stores the number of kernels which acts as a parameter for the LP
Definition at line 122 of file MKLMultiClassGradient.h.
|
protected |
stores the L^p norm which acts as a parameter for the LP
Definition at line 129 of file MKLMultiClassGradient.h.
|
protected |
stores the bias type term of constraints, sumsofalphas[i] belongs to the i-th constraint
Definition at line 127 of file MKLMultiClassGradient.h.