SHOGUN  v2.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 
17 
18 namespace shogun
19 {
20 
25 enum ESolver
26 {
27  BMRM=1,
28  PPBMRM=2,
29  P3BMRM=3
30 };
31 
47 {
48  public:
51 
61  CStructuredModel* model,
62  CLossFunction* loss,
63  CStructuredLabels* labs,
64  float64_t _lambda,
66 
69 
71  virtual const char* get_name() const { return "DualLibQPBMSOSVM"; }
72 
77  inline void set_lambda(float64_t _lambda) { m_lambda=_lambda; }
78 
83  inline float64_t get_lambda() { return m_lambda; }
84 
89  inline void set_TolRel(float64_t TolRel) { m_TolRel=TolRel; }
90 
95  inline float64_t get_TolRel() { return m_TolRel; }
96 
101  inline void set_TolAbs(float64_t TolAbs) { m_TolAbs=TolAbs; }
102 
107  inline float64_t get_TolAbs() { return m_TolAbs; }
108 
114  inline void set_BufSize(uint32_t BufSize) { m_BufSize=BufSize; }
115 
120  inline uint32_t get_BufSize() { return m_BufSize; }
121 
127  inline void set_cleanICP(bool cleanICP) { m_cleanICP=cleanICP; }
128 
133  inline bool get_cleanICP() { return m_cleanICP; }
134 
140  inline void set_cleanAfter(uint32_t cleanAfter) { m_cleanAfter=cleanAfter; }
141 
147  inline uint32_t get_cleanAfter() { return m_cleanAfter; }
148 
153  inline void set_K(float64_t K) { m_K=K; }
154 
159  inline float64_t get_K() { return m_K; }
160 
165  inline void set_Tmax(uint32_t Tmax) { m_Tmax=Tmax; }
166 
171  inline uint32_t get_Tmax() { return m_Tmax; }
172 
177  inline void set_cp_models(uint32_t cp_models) { m_cp_models=cp_models; }
178 
183  inline uint32_t get_cp_models() { return m_cp_models; }
184 
189  inline void set_verbose(bool verbose) { m_verbose=verbose; }
190 
195  inline bool get_verbose() { return m_verbose; }
196 
201  inline bmrm_return_value_T get_result() { return m_result; }
202 
207  inline ESolver get_solver() { return m_solver; }
208 
213  inline void set_solver(ESolver solver) { m_solver=solver; }
214 
220  {
221  REQUIRE(W.vlen == m_model->get_dim(), "Dimension of the initial "
222  "solution must match the model's dimension!\n");
223  m_w=W;
224  }
225 
226  protected:
230  bool train_machine(CFeatures* data=NULL);
231 
232  private:
236  void init();
237 
238  private:
239 
241  float64_t m_lambda;
242 
244  float64_t m_TolRel;
245 
247  float64_t m_TolAbs;
248 
250  uint32_t m_BufSize;
251 
253  bool m_cleanICP;
254 
256  uint32_t m_cleanAfter;
257 
259  float64_t m_K;
260 
262  uint32_t m_Tmax;
263 
265  uint32_t m_cp_models;
266 
268  bool m_verbose;
269 
271  bmrm_return_value_T m_result;
272 
274  ESolver m_solver;
275 
276 }; /* class CDualLibQPBMSOSVM */
277 
278 } /* namespace shogun */
279 
280 #endif /* _DUALLIBQPBMSOSVM__H__ */

SHOGUN Machine Learning Toolbox - Documentation