Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _PRIMAL_MOSEK_SOSVM__H__
00012 #define _PRIMAL_MOSEK_SOSVM__H__
00013
00014 #ifdef USE_MOSEK
00015
00016 #include <shogun/loss/LossFunction.h>
00017 #include <shogun/machine/LinearStructuredOutputMachine.h>
00018 #include <shogun/mathematics/Mosek.h>
00019
00020 namespace shogun
00021 {
00022
00033 class CPrimalMosekSOSVM : public CLinearStructuredOutputMachine
00034 {
00035 public:
00037 CPrimalMosekSOSVM();
00038
00045 CPrimalMosekSOSVM(CStructuredModel* model, CLossFunction* loss, CStructuredLabels* labs);
00046
00048 ~CPrimalMosekSOSVM();
00049
00054 inline SGVector< float64_t > get_slacks() const { return m_slacks; }
00055
00060 virtual float64_t compute_primal_objective() const;
00061
00063 virtual const char* get_name() const { return "PrimalMosekSOSVM"; }
00064
00065 protected:
00071 virtual bool train_machine(CFeatures* data = NULL);
00072
00073 private:
00074 void init();
00075
00081 float64_t compute_loss_arg(CResultSet* result) const;
00082
00088 bool insert_result(CList* result_list, CResultSet* result) const;
00089
00113 bool add_constraint(CMosek* mosek, CResultSet* result, index_t con_idx, index_t train_idx) const;
00114
00115 private:
00117 SGVector< float64_t > m_slacks;
00118
00120 float64_t po_value;
00121
00122 };
00123
00124 }
00125
00126 #endif
00127 #endif