Direct Graphical Models  v.1.7.0
Infer.h
1 // Base abstract class for random model inference
2 // Written by Sergey G. Kosov in 2013 for Chronos Vision GmbH
3 // Adopted by Sergey G. Kosov in 2015 for Project X
4 // Expanded by Sergey G. Kosov in 2016 for Project X
5 #pragma once
6 
7 #include "types.h"
8 
9 namespace DirectGraphicalModels
10 {
11  class CGraph;
12 
13  // ================================ Infer Class ===============================
19  class CInfer
20  {
21  public:
26  DllExport CInfer(CGraph &graph) : m_graph(graph) {}
27  CInfer(const CInfer&) = delete;
28  DllExport virtual ~CInfer() = default;
29  const CInfer& operator= (const CInfer&) = delete;
30 
39  DllExport virtual void infer(unsigned int nIt = 1) = 0;
61  DllExport vec_byte_t decode(unsigned int nIt = 0, Mat &lossMatrix = EmptyMat);
68  DllExport vec_float_t getConfidence(void) const;
74  DllExport vec_float_t getPotentials(byte state) const;
75 
76 
77  protected:
82  CGraph& getGraph(void) const { return m_graph; }
83 
84 
85  private:
87  };
88 }
virtual void infer(unsigned int nIt=1)=0
Inference.
vec_float_t getPotentials(byte state) const
Returns the potnetials for the selected state (class)
Definition: Infer.cpp:33
Interface class for graphical models.
Definition: Graph.h:14
vec_byte_t decode(unsigned int nIt=0, Mat &lossMatrix=EmptyMat)
Approximate decoding.
Definition: Infer.cpp:7
CGraph & getGraph(void) const
Returns the reference to the graph.
Definition: Infer.h:82
vec_float_t getConfidence(void) const
Returns the confidence of the perdiction.
Definition: Infer.cpp:13
CInfer(CGraph &graph)
Constructor.
Definition: Infer.h:26
Base abstract class for random model inference.
Definition: Infer.h:19
const CInfer & operator=(const CInfer &)=delete