SHOGUN  v3.2.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
DualLibQPBMSOSVM.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) 2012 Michal Uricar
8  * Copyright (C) 2012 Michal Uricar
9  */
10 
11 #ifndef _DUALLIBQPBMSOSVM__H__
12 #define _DUALLIBQPBMSOSVM__H__
13 
17 
18 namespace shogun
19 {
20 
25 enum ESolver
26 {
27  BMRM=1,
28  PPBMRM=2,
29  P3BMRM=3,
30  NCBM=4
31 };
32 
48 {
49  public:
52 
61  CStructuredModel* model,
62  CStructuredLabels* labs,
63  float64_t _lambda,
65 
67  virtual ~CDualLibQPBMSOSVM();
68 
70  virtual const char* get_name() const { return "DualLibQPBMSOSVM"; }
71 
76  inline void set_lambda(float64_t _lambda) { m_lambda=_lambda; }
77 
82  inline float64_t get_lambda() { return m_lambda; }
83 
88  inline void set_TolRel(float64_t TolRel) { m_TolRel=TolRel; }
89 
94  inline float64_t get_TolRel() { return m_TolRel; }
95 
100  inline void set_TolAbs(float64_t TolAbs) { m_TolAbs=TolAbs; }
101 
106  inline float64_t get_TolAbs() { return m_TolAbs; }
107 
113  inline void set_BufSize(uint32_t BufSize) { m_BufSize=BufSize; }
114 
119  inline uint32_t get_BufSize() { return m_BufSize; }
120 
126  inline void set_cleanICP(bool cleanICP) { m_cleanICP=cleanICP; }
127 
132  inline bool get_cleanICP() { return m_cleanICP; }
133 
139  inline void set_cleanAfter(uint32_t cleanAfter) { m_cleanAfter=cleanAfter; }
140 
146  inline uint32_t get_cleanAfter() { return m_cleanAfter; }
147 
152  inline void set_K(float64_t K) { m_K=K; }
153 
158  inline float64_t get_K() { return m_K; }
159 
164  inline void set_Tmax(uint32_t Tmax) { m_Tmax=Tmax; }
165 
170  inline uint32_t get_Tmax() { return m_Tmax; }
171 
176  inline void set_cp_models(uint32_t cp_models) { m_cp_models=cp_models; }
177 
182  inline uint32_t get_cp_models() { return m_cp_models; }
183 
188  inline BmrmStatistics get_result() { return m_result; }
189 
194  inline ESolver get_solver() { return m_solver; }
195 
200  inline void set_solver(ESolver solver) { m_solver=solver; }
201 
207  {
208  REQUIRE(W.vlen == m_model->get_dim(), "Dimension of the initial "
209  "solution must match the model's dimension!\n");
210  m_w=W;
211  }
212 
218 
219  protected:
223  bool train_machine(CFeatures* data=NULL);
224 
225  private:
229  void init();
230 
231  private:
232 
234  float64_t m_lambda;
235 
237  float64_t m_TolRel;
238 
240  float64_t m_TolAbs;
241 
243  uint32_t m_BufSize;
244 
246  bool m_cleanICP;
247 
249  uint32_t m_cleanAfter;
250 
252  float64_t m_K;
253 
255  uint32_t m_Tmax;
256 
258  uint32_t m_cp_models;
259 
261  BmrmStatistics m_result;
262 
264  ESolver m_solver;
265 
266 }; /* class CDualLibQPBMSOSVM */
267 
268 } /* namespace shogun */
269 
270 #endif /* _DUALLIBQPBMSOSVM__H__ */
EMachineType
Definition: Machine.h:33
Base class of the labels used in Structured Output (SO) problems.
void set_BufSize(uint32_t BufSize)
void set_w(SGVector< float64_t > W)
Class DualLibQPBMSOSVM that uses Bundle Methods for Regularized Risk Minimization algorithms for stru...
#define REQUIRE(x,...)
Definition: SGIO.h:208
void set_cleanICP(bool cleanICP)
virtual int32_t get_dim() const =0
double float64_t
Definition: common.h:48
virtual const char * get_name() const
void set_TolAbs(float64_t TolAbs)
void set_lambda(float64_t _lambda)
Class CStructuredModel that represents the application specific model and contains most of the applic...
void set_Tmax(uint32_t Tmax)
The class Features is the base class of all feature objects.
Definition: Features.h:62
void set_cp_models(uint32_t cp_models)
bool train_machine(CFeatures *data=NULL)
void set_cleanAfter(uint32_t cleanAfter)
void set_TolRel(float64_t TolRel)
void set_solver(ESolver solver)
virtual EMachineType get_classifier_type()
index_t vlen
Definition: SGVector.h:706
static uint32_t BufSize
Definition: libbmrm.cpp:28

SHOGUN Machine Learning Toolbox - Documentation