SHOGUN  v3.2.0
MKLMulticlass.h
浏览该文件的文档.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2009 Alexander Binder
8  * Copyright (C) 2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  *
10  * Update to patch 0.10.0 - thanks to Eric aka Yoo (thereisnoknife@gmail.com)
11  *
12  */
13 
14 #ifndef MKLMulticlass_H_
15 #define MKLMulticlass_H_
16 
17 #include <vector>
18 
19 #include <shogun/base/SGObject.h>
20 #include <shogun/kernel/Kernel.h>
26 
27 
28 namespace shogun
29 {
30 
42 {
43 public:
46 
53 
55  virtual ~CMKLMulticlass();
56 
62  { return CT_MKLMULTICLASS; }
63 
72  float64_t* getsubkernelweights(int32_t & numweights);
73 
81  void set_mkl_epsilon(float64_t eps );
82 
90  void set_max_num_mkliters(int32_t maxnum);
91 
95  virtual void set_mkl_norm(float64_t norm);
96 
97 protected:
102  CMKLMulticlass( const CMKLMulticlass & cm);
103 
109 
114  void initlpsolver();
115 
119  void initsvm();
120 
121 
127  virtual bool evaluatefinishcriterion(const int32_t
128  numberofsilpiterations);
129 
130 
140  void addingweightsstep( const std::vector<float64_t> & curweights);
141 
147 
155  const int32_t ind);
156 
165  virtual bool train_machine(CFeatures* data=NULL);
166 
168  virtual const char* get_name() const { return "MKLMulticlass"; }
169 
170 protected:
176 
179 
181  ::std::vector< std::vector< float64_t> > weightshistory;
182 
187 
192 
197 
202  std::vector<float64_t> normweightssquared;
203 
205  std::vector<float64_t> oldnormweightssquared;
206 
211 };
212 
213 }
214 #endif // GMNPMKL_H_
std::vector< float64_t > oldnormweightssquared
EMachineType
Definition: Machine.h:33
virtual const char * get_name() const
double norm(double *v, double p, int n)
Definition: epph.cpp:452
MKLMulticlass is a class for L1-norm Multiclass MKL.
Definition: MKLMulticlass.h:41
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:35
void addingweightsstep(const std::vector< float64_t > &curweights)
virtual void set_mkl_norm(float64_t norm)
CMKLMulticlass operator=(const CMKLMulticlass &cm)
virtual bool evaluatefinishcriterion(const int32_t numberofsilpiterations)
float64_t getsquarenormofprimalcoefficients(const int32_t ind)
class MultiClassSVM
Definition: MulticlassSVM.h:26
double float64_t
Definition: common.h:48
::std::vector< std::vector< float64_t > > weightshistory
float64_t getsumofsignfreealphas()
MKLMulticlassOptimizationBase is a helper class for MKLMulticlass.
float64_t * getsubkernelweights(int32_t &numweights)
MKLMulticlassOptimizationBase * lpw
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:16
Class GMNPSVM implements a one vs. rest MultiClass SVM.
Definition: GMNPSVM.h:24
The class Features is the base class of all feature objects.
Definition: Features.h:62
std::vector< float64_t > normweightssquared
void set_mkl_epsilon(float64_t eps)
The Kernel base class.
Definition: Kernel.h:150
virtual bool train_machine(CFeatures *data=NULL)
virtual EMachineType get_classifier_type()
Definition: MKLMulticlass.h:61
void set_max_num_mkliters(int32_t maxnum)

SHOGUN Machine Learning Toolbox - Documentation