SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
FactorGraphLabels.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  * Copyright (C) 2013 Shell Hu
9  */
10 
11 #ifndef __FACTORGRAPH_LABELS_H__
12 #define __FACTORGRAPH_LABELS_H__
13 
14 #include <shogun/lib/config.h>
15 
17 #include <shogun/lib/SGVector.h>
20 
21 namespace shogun
22 {
23 
24 class CFactorGraphLabels;
25 
29 {
30 public:
33 
36 
43  SGVector<float64_t> loss_weights);
44 
46 
52  {
53  if ( base_data->get_structured_data_type() == SDT_FACTOR_GRAPH )
54  return (CFactorGraphObservation*) base_data;
55  else
56  SG_SERROR("base_data must be of dynamic type CFactorGraphObservation\n")
57 
58  return NULL;
59  }
60 
62  virtual const char* get_name() const { return "FactorGraphObservation"; }
63 
66 
69 
74  void set_loss_weights(SGVector<float64_t> loss_weights);
75 
76 protected:
79 
82 };
83 
84 
90 {
91  public:
94 
99  CFactorGraphLabels(int32_t num_labels);
100 
102  virtual ~CFactorGraphLabels();
103 
105  virtual const char* get_name() const { return "FactorGraphLabels"; }
106 
107  private:
109  void init();
110 
111 }; /* CFactorGraphLabels */
112 
113 } /* namespace shogun */
114 
115 #endif /* __FACTORGRAPH_LABELS_H__ */
virtual const char * get_name() const
Base class of the labels used in Structured Output (SO) problems.
SGVector< int32_t > get_data() const
SGVector< float64_t > get_loss_weights() const
SGVector< int32_t > m_observed_state
Class FactorGraphLabels used e.g. in the application of Structured Output (SO) learning with the Fact...
virtual EStructuredDataType get_structured_data_type() const
void set_loss_weights(SGVector< float64_t > loss_weights)
SGVector< float64_t > m_loss_weights
Class CFactorGraphObservation is used as the structured output.
static CFactorGraphObservation * obtain_from_generic(CStructuredData *base_data)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
#define SG_SERROR(...)
Definition: SGIO.h:179
virtual const char * get_name() const
Base class of the components of StructuredLabels.
STRUCTURED_DATA_TYPE(SDT_FACTOR_GRAPH)

SHOGUN Machine Learning Toolbox - Documentation