SHOGUN  4.1.0
 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 {
35  GRAPH_CUT = 4,
36  GEMPLP = 5
37 };
38 
39 class CMAPInferImpl;
40 
46 class CMAPInference : public CSGObject
47 {
48 public:
50  CMAPInference();
51 
57  CMAPInference(CFactorGraph* fg, EMAPInferType inference_method);
58 
60  virtual ~CMAPInference();
61 
63  virtual const char* get_name() const { return "MAPInference"; }
64 
66  virtual void inference();
67 
73 
75  float64_t get_energy() const;
76 
77 private:
79  void init();
80 
81 protected:
84 
87 
90 
93 };
94 
98 class CMAPInferImpl : public CSGObject
99 {
100 public:
102  CMAPInferImpl();
103 
109 
111  virtual ~CMAPInferImpl();
112 
114  virtual const char* get_name() const { return "MAPInferImpl"; }
115 
120  virtual float64_t inference(SGVector<int32_t> assignment) = 0;
121 
122 private:
124  void register_parameters();
125 
126 protected:
129 };
130 
131 }
132 
133 #endif

SHOGUN Machine Learning Toolbox - Documentation