SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
classifier
mkl
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
>
21
#include <
shogun/kernel/CombinedKernel.h
>
22
#include <
shogun/multiclass/GMNPSVM.h
>
23
#include <
shogun/classifier/mkl/MKLMulticlassGLPK.h
>
24
#include <
shogun/classifier/mkl/MKLMulticlassGradient.h
>
25
#include <
shogun/multiclass/MulticlassSVM.h
>
26
27
28
namespace
shogun
29
{
30
41
class
CMKLMulticlass
:
public
CMulticlassSVM
42
{
43
public
:
45
CMKLMulticlass
();
46
52
CMKLMulticlass
(
float64_t
C,
CKernel
* k,
CLabels
* lab);
53
55
virtual
~CMKLMulticlass
();
56
61
virtual
inline
EMachineType
get_classifier_type
()
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
108
CMKLMulticlass
operator=
(
const
CMKLMulticlass
& cm);
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
146
float64_t
getsumofsignfreealphas
();
147
154
float64_t
getsquarenormofprimalcoefficients
(
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
:
175
CGMNPSVM
*
svm
;
176
178
MKLMulticlassOptimizationBase
*
lpw
;
179
181
::std::vector< std::vector< float64_t> >
weightshistory
;
182
186
float64_t
mkl_eps
;
187
191
int32_t
max_num_mkl_iters
;
192
196
float64_t
pnorm
;
197
202
std::vector<float64_t>
normweightssquared
;
203
205
std::vector<float64_t>
oldnormweightssquared
;
206
208
float64_t
curalphaterm
;
210
float64_t
oldalphaterm
;
211
};
212
213
}
214
#endif // GMNPMKL_H_
SHOGUN
机器学习工具包 - 项目文档