Direct Graphical Models  v.1.5.1
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
CGraphm_pGraph
 Pointer to the graph. More...
 

Detailed Description

Exact inference class.

Note
Use this class only if \( nStates^{nNodes} < 2^{32}\)
Author
Sergey G. Kosov, serge.nosp@m.y.ko.nosp@m.sov@p.nosp@m.roje.nosp@m.ct-10.nosp@m..de

Definition at line 16 of file InferExact.h.

Constructor & Destructor Documentation

DirectGraphicalModels::CInferExact::CInferExact ( CGraph pGraph)
inline

Constructor.

Parameters
pGraphThe graph

Definition at line 23 of file InferExact.h.

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

Definition at line 24 of file InferExact.h.

Member Function Documentation

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

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!
Parameters
nItis not used
Note
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:


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