SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MAPInference.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 __MAP_INFERENCE_H__
12 #define __MAP_INFERENCE_H__
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/base/SGObject.h>
17 #include <shogun/lib/SGVector.h>
20 
21 namespace shogun
22 {
23 
30 {
36 };
37 
38 class CMAPInferImpl;
39 
45 class CMAPInference : public CSGObject
46 {
47 public:
49  CMAPInference();
50 
56  CMAPInference(CFactorGraph* fg, EMAPInferType inference_method);
57 
59  virtual ~CMAPInference();
60 
62  virtual const char* get_name() const { return "MAPInference"; }
63 
65  virtual void inference();
66 
72 
74  float64_t get_energy() const;
75 
76 private:
78  void init();
79 
80 protected:
83 
86 
89 
92 };
93 
97 class CMAPInferImpl : public CSGObject
98 {
99 public:
101  CMAPInferImpl();
102 
108 
110  virtual ~CMAPInferImpl();
111 
113  virtual const char* get_name() const { return "MAPInferImpl"; }
114 
119  virtual float64_t inference(SGVector<int32_t> assignment) = 0;
120 
121 private:
123  void register_parameters();
124 
125 protected:
128 };
129 
130 }
131 
132 #endif

SHOGUN Machine Learning Toolbox - Documentation