SHOGUN  4.1.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 
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  inline void set_store_train_info(bool store_train_info)
221  {
222  m_store_train_info=store_train_info;
223  }
224 
230 
231  protected:
235  bool train_machine(CFeatures* data=NULL);
236 
237  private:
241  void init();
242 
243  private:
244 
246  float64_t m_lambda;
247 
249  float64_t m_TolRel;
250 
252  float64_t m_TolAbs;
253 
255  uint32_t m_BufSize;
256 
258  bool m_cleanICP;
259 
261  uint32_t m_cleanAfter;
262 
264  float64_t m_K;
265 
267  uint32_t m_Tmax;
268 
270  uint32_t m_cp_models;
271 
273  BmrmStatistics m_result;
274 
276  ESolver m_solver;
277 
279  bool m_store_train_info;
280 
281 }; /* class CDualLibQPBMSOSVM */
282 
283 } /* namespace shogun */
284 
285 #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...
void set_store_train_info(bool store_train_info)
#define REQUIRE(x,...)
Definition: SGIO.h:206
void set_cleanICP(bool cleanICP)
virtual int32_t get_dim() const =0
index_t vlen
Definition: SGVector.h:494
double float64_t
Definition: common.h:50
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...
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
void set_Tmax(uint32_t Tmax)
The class Features is the base class of all feature objects.
Definition: Features.h:68
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()
uint32_t BufSize
Definition: libbmrm.cpp:28

SHOGUN 机器学习工具包 - 项目文档