SHOGUN  v3.0.0
 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 
16 
17 namespace shogun
18 {
19 
24 enum ESolver
25 {
26  BMRM=1,
27  PPBMRM=2,
28  P3BMRM=3,
29  NCBM=4
30 };
31 
47 {
48  public:
51 
60  CStructuredModel* model,
61  CStructuredLabels* labs,
62  float64_t _lambda,
64 
66  virtual ~CDualLibQPBMSOSVM();
67 
69  virtual const char* get_name() const { return "DualLibQPBMSOSVM"; }
70 
75  inline void set_lambda(float64_t _lambda) { m_lambda=_lambda; }
76 
81  inline float64_t get_lambda() { return m_lambda; }
82 
87  inline void set_TolRel(float64_t TolRel) { m_TolRel=TolRel; }
88 
93  inline float64_t get_TolRel() { return m_TolRel; }
94 
99  inline void set_TolAbs(float64_t TolAbs) { m_TolAbs=TolAbs; }
100 
105  inline float64_t get_TolAbs() { return m_TolAbs; }
106 
112  inline void set_BufSize(uint32_t BufSize) { m_BufSize=BufSize; }
113 
118  inline uint32_t get_BufSize() { return m_BufSize; }
119 
125  inline void set_cleanICP(bool cleanICP) { m_cleanICP=cleanICP; }
126 
131  inline bool get_cleanICP() { return m_cleanICP; }
132 
138  inline void set_cleanAfter(uint32_t cleanAfter) { m_cleanAfter=cleanAfter; }
139 
145  inline uint32_t get_cleanAfter() { return m_cleanAfter; }
146 
151  inline void set_K(float64_t K) { m_K=K; }
152 
157  inline float64_t get_K() { return m_K; }
158 
163  inline void set_Tmax(uint32_t Tmax) { m_Tmax=Tmax; }
164 
169  inline uint32_t get_Tmax() { return m_Tmax; }
170 
175  inline void set_cp_models(uint32_t cp_models) { m_cp_models=cp_models; }
176 
181  inline uint32_t get_cp_models() { return m_cp_models; }
182 
187  inline void set_verbose(bool verbose) { m_verbose=verbose; }
188 
193  inline bool get_verbose() { return m_verbose; }
194 
199  inline BmrmStatistics get_result() { return m_result; }
200 
205  inline ESolver get_solver() { return m_solver; }
206 
211  inline void set_solver(ESolver solver) { m_solver=solver; }
212 
218  {
219  REQUIRE(W.vlen == m_model->get_dim(), "Dimension of the initial "
220  "solution must match the model's dimension!\n");
221  m_w=W;
222  }
223 
229 
230  protected:
234  bool train_machine(CFeatures* data=NULL);
235 
236  private:
240  void init();
241 
242  private:
243 
245  float64_t m_lambda;
246 
248  float64_t m_TolRel;
249 
251  float64_t m_TolAbs;
252 
254  uint32_t m_BufSize;
255 
257  bool m_cleanICP;
258 
260  uint32_t m_cleanAfter;
261 
263  float64_t m_K;
264 
266  uint32_t m_Tmax;
267 
269  uint32_t m_cp_models;
270 
272  bool m_verbose;
273 
275  BmrmStatistics m_result;
276 
278  ESolver m_solver;
279 
280 }; /* class CDualLibQPBMSOSVM */
281 
282 } /* namespace shogun */
283 
284 #endif /* _DUALLIBQPBMSOSVM__H__ */

SHOGUN Machine Learning Toolbox - Documentation