Direct Graphical Models  v.1.5.2
DirectGraphicalModels::CInferExact Class Reference

Exact inference class. More...

#include <InferExact.h>

Inheritance diagram for DirectGraphicalModels::CInferExact:
Collaboration diagram for DirectGraphicalModels::CInferExact:

Public Member Functions

 CInferExact (CGraph *pGraph)
 Constructor. More...
virtual ~CInferExact (void)
virtual void infer (unsigned int nIt=0)
 Exact inference. More...
- Public Member Functions inherited from DirectGraphicalModels::CInfer
 CInfer (CGraph *pGraph)
 Constructor. More...
virtual ~CInfer (void)
virtual vec_byte_t decode (unsigned int nIt=0, Mat &lossMatrix=Mat())
 Approximate decoding. More...
vec_float_t getConfidence (void) const
 Returns the confidence of the prediction. More...
vec_float_t getPotentials (byte state) const
 Returns the potnetials for the selected state (class) More...

Additional Inherited Members

- Protected Member Functions inherited from DirectGraphicalModels::CDecode
 CDecode (CGraph *pGraph)
 Constructor. More...
void setState (vec_byte_t &state, qword configuration) const
 Sets the state according to the configuration index configuration. More...
void incState (vec_byte_t &state) const
 Increases the state by one, i.e. switches the state array to the consequent configuration. More...
vec_float_t calculatePotentials (void) const
 Calculates potentials for all possible configurations. More...
virtual ~CDecode (void)
virtual vec_byte_t decode (unsigned int nIt=0, Mat &lossMatrix=Mat()) const
 Approximate decoding. More...
- Static Protected Member Functions inherited from DirectGraphicalModels::CDecode
static vec_byte_t decode (const CGraph *pGraph, Mat &lossMatrix=Mat())
 Approximate decoding. More...
static Mat getDefaultLossMatrix (byte nStates)
 Returns a default loss matrix \(L\). More...
- Protected Attributes inherited from DirectGraphicalModels::CDecode
 Pointer to the graph. More...

Detailed Description

Exact inference class.

Use this class only if \( nStates^{nNodes} < 2^{32}\)
Sergey G. Kosov,

Definition at line 16 of file InferExact.h.

Constructor & Destructor Documentation

◆ CInferExact()

DirectGraphicalModels::CInferExact::CInferExact ( CGraph pGraph)


pGraphThe graph

Definition at line 23 of file InferExact.h.

◆ ~CInferExact()

virtual DirectGraphicalModels::CInferExact::~CInferExact ( void  )

Definition at line 24 of file InferExact.h.

Here is the call graph for this function:

Member Function Documentation

◆ infer()

void DirectGraphicalModels::CInferExact::infer ( unsigned int  nIt = 0)

Exact inference.

This function estimates the most likely configuration, based on the marginal probabilities (potentials) in graph nodes, which in general is NOT the same as the set of most likely states. It means the following:

using namespace DirectGraphicalModels;
CGraph * graph = new CGraph(nStates);
CInfer * inferer = new CInferExact(graph);
CDecode * decoder = new CDecodeExact(graph);
inferer->decode() == decoder->decode(); // This statement is not always true!
nItis not used
This function changes the graph nodes' potentials

Implements DirectGraphicalModels::CInfer.

Definition at line 7 of file InferExact.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: