SHOGUN  v3.2.0
PrimalMosekSOSVM.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 Fernando José Iglesias García
8  * Copyright (C) 2012 Fernando José Iglesias García
9  */
10 
11 #ifndef _PRIMAL_MOSEK_SOSVM__H__
12 #define _PRIMAL_MOSEK_SOSVM__H__
13 
14 #ifdef USE_MOSEK
15 
18 
19 namespace shogun
20 {
21 
32 class CPrimalMosekSOSVM : public CLinearStructuredOutputMachine
33 {
34  public:
36  CPrimalMosekSOSVM();
37 
43  CPrimalMosekSOSVM(CStructuredModel* model, CStructuredLabels* labs);
44 
46  ~CPrimalMosekSOSVM();
47 
52  inline SGVector< float64_t > get_slacks() const { return m_slacks; }
53 
58  virtual float64_t compute_primal_objective() const;
59 
61  virtual const char* get_name() const { return "PrimalMosekSOSVM"; }
62 
67  virtual EMachineType get_classifier_type();
68 
73  void set_regularization(float64_t C);
74 
80 
81  protected:
87  virtual bool train_machine(CFeatures* data = NULL);
88 
89  private:
90  void init();
91 
97  float64_t compute_loss_arg(CResultSet* result) const;
98 
104  bool insert_result(CList* result_list, CResultSet* result) const;
105 
129  bool add_constraint(CMosek* mosek, CResultSet* result, index_t con_idx, index_t train_idx) const;
130 
131  private:
133  SGVector< float64_t > m_slacks;
134 
136  float64_t po_value;
137 
139  float64_t m_regularization;
140 
142  float64_t m_epsilon;
143 
144 }; /* class CPrimalMosekSOSVM */
145 
146 } /* namespace shogun */
147 
148 #endif /* USE_MOSEK */
149 #endif /* _PRIMAL_MOSEK_SOSVM__H__ */
EMachineType
Definition: Machine.h:33
int32_t index_t
Definition: common.h:60
static const float64_t epsilon
Definition: libbmrm.cpp:25
double float64_t
Definition: common.h:48
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:16
void set_epsilon(float *begin, float max)
Definition: JLCoverTree.h:510

SHOGUN Machine Learning Toolbox - Documentation