SHOGUN  3.2.1
 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/config.h>
15 
16 #include <shogun/lib/SGString.h>
21 
22 namespace shogun
23 {
24 
33 {
34 public:
37 
47  EMAPInferType inf_type = TREE_MAX_PROD, bool verbose = false);
48 
51 
53  virtual const char* get_name() const { return "FactorGraphModel"; }
54 
61  void add_factor_type(CFactorType* ftype);
62 
67  void del_factor_type(const int32_t ftype_id);
68 
71 
76  CFactorType* get_factor_type(const int32_t ftype_id) const;
77 
80 
85  SGVector<int32_t> get_params_mapping(const int32_t ftype_id);
86 
89 
95 
108  virtual SGVector< float64_t > get_joint_feature_vector(int32_t feat_idx, CStructuredData* y);
109 
123  virtual CResultSet* argmax(SGVector< float64_t > w, int32_t feat_idx, bool const training = true);
124 
133 
138  virtual void init_training();
139 
151  virtual void init_primal_opt(
152  float64_t regularization,
157 
162  virtual int32_t get_dim() const;
163 
164 private:
166  void init();
167 
168 protected:
171 
174 
177 
180 
182  bool m_verbose;
183 };
184 
185 }
186 
187 #endif
188 

SHOGUN Machine Learning Toolbox - Documentation