SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
CGMNPLib Class Reference

Detailed Description

class GMNPLib Library of solvers for Generalized Minimal Norm Problem (GMNP).

Generalized Minimal Norm Problem to solve is

min 0.5*alpha'*H*alpha + c'*alpha

subject to sum(alpha) = 1, alpha(i) >= 0

H [dim x dim] is symmetric positive definite matrix. c [dim x 1] is an arbitrary vector.

The precision of the found solution is given by the parameters tmax, tolabs and tolrel which define the stopping conditions:

UB-LB <= tolabs -> exit_flag = 1 Abs. tolerance. UB-LB <= UB*tolrel -> exit_flag = 2 Relative tolerance. LB > th -> exit_flag = 3 Threshold on lower bound. t >= tmax -> exit_flag = 0 Number of iterations.

UB ... Upper bound on the optimal solution. LB ... Lower bound on the optimal solution. t ... Number of iterations. History ... Value of LB and UB wrt. number of iterations.

The following algorithms are implemented: ..............................................

Definition at line 66 of file GMNPLib.h.

Inheritance diagram for CGMNPLib:
Inheritance graph
[legend]

Public Member Functions

 CGMNPLib ()
 CGMNPLib (float64_t *vector_y, CKernel *kernel, int32_t num_data, int32_t num_virtual_data, int32_t num_classes, float64_t reg_const)
virtual ~CGMNPLib ()
int8_t gmnp_imdm (float64_t *vector_c, int32_t dim, int32_t tmax, float64_t tolabs, float64_t tolrel, float64_t th, float64_t *alpha, int32_t *ptr_t, float64_t **ptr_History, int32_t verb)
void get_indices2 (int32_t *index, int32_t *c, int32_t i)
- Public Member Functions inherited from CSGObject
 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)
SGIOget_global_io ()
void set_global_parallel (Parallel *parallel)
Parallelget_global_parallel ()
void set_global_version (Version *version)
Versionget_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

float64_tget_kernel_col (int32_t a)
float64_tget_col (int32_t a, int32_t b)
float64_t kernel_fce (int32_t a, int32_t b)
virtual const char * get_name () const
- Protected Member Functions inherited from CSGObject
virtual void load_serializable_pre () throw (ShogunException)
virtual void load_serializable_post () throw (ShogunException)
virtual void save_serializable_pre () throw (ShogunException)
virtual void save_serializable_post () throw (ShogunException)

Protected Attributes

float64_tdiag_H
float64_t ** kernel_columns
float64_tcache_index
int32_t first_kernel_inx
int64_t Cache_Size
int32_t m_num_data
float64_t m_reg_const
float64_tm_vector_y
CKernelm_kernel
int32_t first_virt_inx
float64_tvirt_columns [3]
int32_t m_num_virt_data
int32_t m_num_classes

Additional Inherited Members

- Public Attributes inherited from CSGObject
SGIOio
Parallelparallel
Versionversion
Parameterm_parameters
Parameterm_model_selection_parameters

Constructor & Destructor Documentation

CGMNPLib ( )

default constructor

Definition at line 80 of file GMNPLib.cpp.

CGMNPLib ( float64_t vector_y,
CKernel kernel,
int32_t  num_data,
int32_t  num_virtual_data,
int32_t  num_classes,
float64_t  reg_const 
)

constructor

Parameters
vector_yvector y
kernelkernel
num_datanumber of data
num_virtual_datanumber of virtual data
num_classesnumber of classes
reg_constreg const

Definition at line 100 of file GMNPLib.cpp.

~CGMNPLib ( )
virtual

Definition at line 143 of file GMNPLib.cpp.

Member Function Documentation

float64_t * get_col ( int32_t  a,
int32_t  b 
)
protected

get col

Parameters
aa
bb
Returns
col at a, b

Definition at line 212 of file GMNPLib.cpp.

void get_indices2 ( int32_t *  index,
int32_t *  c,
int32_t  i 
)

get indices2

Parameters
indexindex
cc
ii

Definition at line 194 of file GMNPLib.cpp.

float64_t * get_kernel_col ( int32_t  a)
protected

get kernel col

Parameters
aa
Returns
col at a

Definition at line 161 of file GMNPLib.cpp.

virtual const char* get_name ( ) const
protectedvirtual
Returns
object name

Implements CSGObject.

Definition at line 140 of file GMNPLib.h.

int8_t gmnp_imdm ( float64_t vector_c,
int32_t  dim,
int32_t  tmax,
float64_t  tolabs,
float64_t  tolrel,
float64_t  th,
float64_t alpha,
int32_t *  ptr_t,
float64_t **  ptr_History,
int32_t  verb 
)
        --------------------------------------------------------------
      GMNP solver based on improved MDM algorithm 1.

      Search strategy: u determined by common rule and v is 
      optimized.

Usage: exitflag = gmnp_imdm( &get_col, diag_H, vector_c, dim,

tmax, tolabs, tolrel, th, &alpha, &t, &History );

Definition at line 260 of file GMNPLib.cpp.

float64_t kernel_fce ( int32_t  a,
int32_t  b 
)
protected

kernel fce

Parameters
aa
bb
Returns
something floaty

Definition at line 477 of file GMNPLib.cpp.

Member Data Documentation

float64_t* cache_index
protected

cache index

Definition at line 148 of file GMNPLib.h.

int64_t Cache_Size
protected

cache size

Definition at line 152 of file GMNPLib.h.

float64_t* diag_H
protected

diag H

Definition at line 144 of file GMNPLib.h.

int32_t first_kernel_inx
protected

first kernel inx

Definition at line 150 of file GMNPLib.h.

int32_t first_virt_inx
protected

index of first used column

Definition at line 163 of file GMNPLib.h.

float64_t** kernel_columns
protected

kernel columns

Definition at line 146 of file GMNPLib.h.

CKernel* m_kernel
protected

kernel

Definition at line 160 of file GMNPLib.h.

int32_t m_num_classes
protected

number of classes

Definition at line 169 of file GMNPLib.h.

int32_t m_num_data
protected

num data

Definition at line 154 of file GMNPLib.h.

int32_t m_num_virt_data
protected

number of virt data

Definition at line 167 of file GMNPLib.h.

float64_t m_reg_const
protected

reg const

Definition at line 156 of file GMNPLib.h.

float64_t* m_vector_y
protected

vectory

Definition at line 158 of file GMNPLib.h.

float64_t* virt_columns[3]
protected

cache for three columns

Definition at line 165 of file GMNPLib.h.


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

SHOGUN Machine Learning Toolbox - Documentation