SHOGUN  3.2.1
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
FactorGraphModel.h
浏览该文件的文档.
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 
45  EMAPInferType inf_type = TREE_MAX_PROD, bool verbose = false);
46 
49 
51  virtual const char* get_name() const { return "FactorGraphModel"; }
52 
59  void add_factor_type(CFactorType* ftype);
60 
65  void del_factor_type(const int32_t ftype_id);
66 
69 
74  CFactorType* get_factor_type(const int32_t ftype_id) const;
75 
78 
83  SGVector<int32_t> get_params_mapping(const int32_t ftype_id);
84 
87 
93 
106  virtual SGVector< float64_t > get_joint_feature_vector(int32_t feat_idx, CStructuredData* y);
107 
121  virtual CResultSet* argmax(SGVector< float64_t > w, int32_t feat_idx, bool const training = true);
122 
131 
136  virtual void init_training();
137 
149  virtual void init_primal_opt(
150  float64_t regularization,
155 
160  virtual int32_t get_dim() const;
161 
162 private:
164  void init();
165 
166 protected:
169 
172 
175 
178 
180  bool m_verbose;
181 };
182 
183 }
184 
185 #endif
186 

SHOGUN 机器学习工具包 - 项目文档