SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FactorGraphModel.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 __FACTOR_GRAPH_MODEL_H__
12 #define __FACTOR_GRAPH_MODEL_H__
13 
14 #include <shogun/lib/SGString.h>
19 
20 namespace shogun
21 {
22 
31 {
32 public:
35 
42  CFactorGraphModel(CFeatures* features, CStructuredLabels* labels,
43  EMAPInferType inf_type = TREE_MAX_PROD, bool verbose = false);
44 
47 
49  virtual const char* get_name() const { return "FactorGraphModel"; }
50 
57  void add_factor_type(CFactorType* ftype);
58 
63  void del_factor_type(const int32_t ftype_id);
64 
67 
72  CFactorType* get_factor_type(const int32_t ftype_id) const;
73 
76 
81  SGVector<int32_t> get_params_mapping(const int32_t ftype_id);
82 
85 
91 
104  virtual SGVector< float64_t > get_joint_feature_vector(int32_t feat_idx, CStructuredData* y);
105 
119  virtual CResultSet* argmax(SGVector< float64_t > w, int32_t feat_idx, bool const training = true);
120 
129 
134  virtual void init_training();
135 
147  virtual void init_primal_opt(
148  float64_t regularization,
153 
158  virtual int32_t get_dim() const;
159 
160 private:
162  void init();
163 
164 protected:
167 
170 
173 
176 
178  bool m_verbose;
179 };
180 
181 }
182 
183 #endif
184 

SHOGUN Machine Learning Toolbox - Documentation