SHOGUN  v3.1.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StructuredOutputMachine.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) 2013 Shell Hu
8  * Written (W) 2012 Fernando José Iglesias García
9  * Copyright (C) 2012 Fernando José Iglesias García
10  */
11 
12 #ifndef _STRUCTURED_OUTPUT_MACHINE__H__
13 #define _STRUCTURED_OUTPUT_MACHINE__H__
14 
17 #include <shogun/machine/Machine.h>
21 
22 namespace shogun
23 {
24 
31 {
37 };
38 
39 class CStructuredModel;
40 
43 {
44  public:
47 
50 
57 
59  virtual ~CStructuredOutputMachine();
60 
65  void set_model(CStructuredModel* model);
66 
71  CStructuredModel* get_model() const;
72 
74  virtual const char* get_name() const
75  {
76  return "StructuredOutputMachine";
77  }
78 
83  virtual void set_labels(CLabels* lab);
84 
89  void set_features(CFeatures* f);
90 
95  CFeatures* get_features() const;
96 
101  void set_surrogate_loss(CLossFunction* loss);
102 
108 
117  virtual float64_t risk(float64_t* subgrad, float64_t* W,
119 
121  CSOSVMHelper* get_helper() const;
122 
129  void set_verbose(bool verbose);
130 
135  bool get_verbose() const;
136 
137  protected:
166 
175 
184 
193 
202 
203  private:
205  void register_parameters();
206 
207  protected:
210 
216 
219 
221  bool m_verbose;
222 
223 }; /* class CStructuredOutputMachine */
224 
225 } /* namespace shogun */
226 
227 #endif /* _STRUCTURED_OUTPUT_MACHINE__H__ */
Base class of the labels used in Structured Output (SO) problems.
Class CLossFunction is the base class of all loss functions.
Definition: LossFunction.h:53
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:35
virtual float64_t risk_customized_formulation(float64_t *subgrad, float64_t *W, TMultipleCPinfo *info=0)
virtual float64_t risk_1slack_slack_rescale(float64_t *subgrad, float64_t *W, TMultipleCPinfo *info=0)
CLossFunction * get_surrogate_loss() const
virtual const char * get_name() const
A generic learning machine interface.
Definition: Machine.h:138
virtual float64_t risk_nslack_margin_rescale(float64_t *subgrad, float64_t *W, TMultipleCPinfo *info=0)
void set_model(CStructuredModel *model)
double float64_t
Definition: common.h:48
class CSOSVMHelper contains helper functions to compute primal objectives, dual objectives, average training losses, duality gaps etc. These values will be recorded to check convergence. This class is inspired by the matlab implementation of the block coordinate Frank-Wolfe SOSVM solver [1].
Definition: SOSVMHelper.h:29
virtual float64_t risk_nslack_slack_rescale(float64_t *subgrad, float64_t *W, TMultipleCPinfo *info=0)
virtual float64_t risk(float64_t *subgrad, float64_t *W, TMultipleCPinfo *info=0, EStructRiskType rtype=N_SLACK_MARGIN_RESCALING)
Class CStructuredModel that represents the application specific model and contains most of the applic...
The class Features is the base class of all feature objects.
Definition: Features.h:62
CStructuredModel * get_model() const
virtual float64_t risk_1slack_margin_rescale(float64_t *subgrad, float64_t *W, TMultipleCPinfo *info=0)
void set_surrogate_loss(CLossFunction *loss)

SHOGUN Machine Learning Toolbox - Documentation