SHOGUN  5.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
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 
15 #include <shogun/lib/config.h>
16 
17 #include <shogun/lib/common.h>
18 #include <shogun/machine/Machine.h>
20 
21 namespace shogun
22 {
23 
24 class CFeatures;
25 class CLabels;
26 class CLossFunction;
27 class CStructuredLabels;
28 struct TMultipleCPinfo;
29 
36 {
42 };
43 
44 class CStructuredModel;
45 
48 {
49  public:
52 
55 
62 
64  virtual ~CStructuredOutputMachine();
65 
70  void set_model(CStructuredModel* model);
71 
76  CStructuredModel* get_model() const;
77 
79  virtual const char* get_name() const
80  {
81  return "StructuredOutputMachine";
82  }
83 
88  virtual void set_labels(CLabels* lab);
89 
94  void set_features(CFeatures* f);
95 
100  CFeatures* get_features() const;
101 
106  void set_surrogate_loss(CLossFunction* loss);
107 
113 
122  virtual float64_t risk(float64_t* subgrad, float64_t* W,
124 
126  CSOSVMHelper* get_helper() const;
127 
134  void set_verbose(bool verbose);
135 
140  bool get_verbose() const;
141 
142  protected:
171 
180 
189 
198 
207 
208  private:
210  void register_parameters();
211 
212  protected:
215 
221 
224 
226  bool m_verbose;
227 
228 }; /* class CStructuredOutputMachine */
229 
230 } /* namespace shogun */
231 
232 #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:57
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
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:143
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:50
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:31
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...
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
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