SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 #ifdef USE_GPL_SHOGUN
16 
20 
21 namespace shogun
22 {
23 
28 enum ESolver
29 {
30  BMRM=1,
31  PPBMRM=2,
32  P3BMRM=3,
33  NCBM=4
34 };
35 
50 class CDualLibQPBMSOSVM : public CLinearStructuredOutputMachine
51 {
52  public:
54  CDualLibQPBMSOSVM();
55 
63  CDualLibQPBMSOSVM(
64  CStructuredModel* model,
65  CStructuredLabels* labs,
66  float64_t _lambda,
68 
70  virtual ~CDualLibQPBMSOSVM();
71 
73  virtual const char* get_name() const { return "DualLibQPBMSOSVM"; }
74 
79  inline void set_lambda(float64_t _lambda) { m_lambda=_lambda; }
80 
85  inline float64_t get_lambda() { return m_lambda; }
86 
91  inline void set_TolRel(float64_t TolRel) { m_TolRel=TolRel; }
92 
97  inline float64_t get_TolRel() { return m_TolRel; }
98 
103  inline void set_TolAbs(float64_t TolAbs) { m_TolAbs=TolAbs; }
104 
109  inline float64_t get_TolAbs() { return m_TolAbs; }
110 
116  inline void set_BufSize(uint32_t BufSize) { m_BufSize=BufSize; }
117 
122  inline uint32_t get_BufSize() { return m_BufSize; }
123 
129  inline void set_cleanICP(bool cleanICP) { m_cleanICP=cleanICP; }
130 
135  inline bool get_cleanICP() { return m_cleanICP; }
136 
142  inline void set_cleanAfter(uint32_t cleanAfter) { m_cleanAfter=cleanAfter; }
143 
149  inline uint32_t get_cleanAfter() { return m_cleanAfter; }
150 
155  inline void set_K(float64_t K) { m_K=K; }
156 
161  inline float64_t get_K() { return m_K; }
162 
167  inline void set_Tmax(uint32_t Tmax) { m_Tmax=Tmax; }
168 
173  inline uint32_t get_Tmax() { return m_Tmax; }
174 
179  inline void set_cp_models(uint32_t cp_models) { m_cp_models=cp_models; }
180 
185  inline uint32_t get_cp_models() { return m_cp_models; }
186 
191  inline BmrmStatistics get_result() { return m_result; }
192 
197  inline ESolver get_solver() { return m_solver; }
198 
203  inline void set_solver(ESolver solver) { m_solver=solver; }
204 
209  inline void set_w(SGVector< float64_t > W)
210  {
211  REQUIRE(W.vlen == m_model->get_dim(), "Dimension of the initial "
212  "solution must match the model's dimension!\n");
213  m_w=W;
214  }
215 
221  inline void set_store_train_info(bool store_train_info)
222  {
223  m_store_train_info=store_train_info;
224  }
225 
230  virtual EMachineType get_classifier_type();
231 
232  protected:
236  bool train_machine(CFeatures* data=NULL);
237 
238  private:
242  void init();
243 
244  private:
245 
247  float64_t m_lambda;
248 
250  float64_t m_TolRel;
251 
253  float64_t m_TolAbs;
254 
256  uint32_t m_BufSize;
257 
259  bool m_cleanICP;
260 
262  uint32_t m_cleanAfter;
263 
265  float64_t m_K;
266 
268  uint32_t m_Tmax;
269 
271  uint32_t m_cp_models;
272 
274  BmrmStatistics m_result;
275 
277  ESolver m_solver;
278 
280  bool m_store_train_info;
281 
282 }; /* class CDualLibQPBMSOSVM */
283 
284 } /* namespace shogun */
285 
286 #endif //USE_GPL_SHOGUN
287 #endif /* _DUALLIBQPBMSOSVM__H__ */
EMachineType
Definition: Machine.h:33
#define REQUIRE(x,...)
Definition: SGIO.h:206
index_t vlen
Definition: SGVector.h:494
double float64_t
Definition: common.h:50
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18

SHOGUN Machine Learning Toolbox - Documentation