SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DualLibQPBMSOSVM.h
Go to the documentation of this file.
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 
14 #include <shogun/lib/config.h>
15 
19 
20 namespace shogun
21 {
22 
27 enum ESolver
28 {
29  BMRM=1,
30  PPBMRM=2,
31  P3BMRM=3,
32  NCBM=4
33 };
34 
50 {
51  public:
54 
63  CStructuredModel* model,
64  CStructuredLabels* labs,
65  float64_t _lambda,
67 
69  virtual ~CDualLibQPBMSOSVM();
70 
72  virtual const char* get_name() const { return "DualLibQPBMSOSVM"; }
73 
78  inline void set_lambda(float64_t _lambda) { m_lambda=_lambda; }
79 
84  inline float64_t get_lambda() { return m_lambda; }
85 
90  inline void set_TolRel(float64_t TolRel) { m_TolRel=TolRel; }
91 
96  inline float64_t get_TolRel() { return m_TolRel; }
97 
102  inline void set_TolAbs(float64_t TolAbs) { m_TolAbs=TolAbs; }
103 
108  inline float64_t get_TolAbs() { return m_TolAbs; }
109 
115  inline void set_BufSize(uint32_t BufSize) { m_BufSize=BufSize; }
116 
121  inline uint32_t get_BufSize() { return m_BufSize; }
122 
128  inline void set_cleanICP(bool cleanICP) { m_cleanICP=cleanICP; }
129 
134  inline bool get_cleanICP() { return m_cleanICP; }
135 
141  inline void set_cleanAfter(uint32_t cleanAfter) { m_cleanAfter=cleanAfter; }
142 
148  inline uint32_t get_cleanAfter() { return m_cleanAfter; }
149 
154  inline void set_K(float64_t K) { m_K=K; }
155 
160  inline float64_t get_K() { return m_K; }
161 
166  inline void set_Tmax(uint32_t Tmax) { m_Tmax=Tmax; }
167 
172  inline uint32_t get_Tmax() { return m_Tmax; }
173 
178  inline void set_cp_models(uint32_t cp_models) { m_cp_models=cp_models; }
179 
184  inline uint32_t get_cp_models() { return m_cp_models; }
185 
190  inline BmrmStatistics get_result() { return m_result; }
191 
196  inline ESolver get_solver() { return m_solver; }
197 
202  inline void set_solver(ESolver solver) { m_solver=solver; }
203 
209  {
210  REQUIRE(W.vlen == m_model->get_dim(), "Dimension of the initial "
211  "solution must match the model's dimension!\n");
212  m_w=W;
213  }
214 
220 
221  protected:
225  bool train_machine(CFeatures* data=NULL);
226 
227  private:
231  void init();
232 
233  private:
234 
236  float64_t m_lambda;
237 
239  float64_t m_TolRel;
240 
242  float64_t m_TolAbs;
243 
245  uint32_t m_BufSize;
246 
248  bool m_cleanICP;
249 
251  uint32_t m_cleanAfter;
252 
254  float64_t m_K;
255 
257  uint32_t m_Tmax;
258 
260  uint32_t m_cp_models;
261 
263  BmrmStatistics m_result;
264 
266  ESolver m_solver;
267 
268 }; /* class CDualLibQPBMSOSVM */
269 
270 } /* namespace shogun */
271 
272 #endif /* _DUALLIBQPBMSOSVM__H__ */

SHOGUN Machine Learning Toolbox - Documentation