Direct Graphical Models  v.1.7.0
DirectGraphicalModels::CDecode Class Reference

Base abstract class for random model decoding. More...

#include <Decode.h>

Inheritance diagram for DirectGraphicalModels::CDecode:
Collaboration diagram for DirectGraphicalModels::CDecode:

Public Member Functions

virtual ~CDecode (void)
 
virtual vec_byte_t decode (Mat &lossMatrix=EmptyMat) const
 Approximate decoding. More...
 

Static Public Member Functions

static vec_byte_t decode (const CGraph &graph, Mat &lossMatrix=EmptyMat)
 Approximate decoding. More...
 
static Mat getDefaultLossMatrix (byte nStates)
 Returns a default loss matrix \(L\). More...
 

Protected Member Functions

 CDecode (CGraph &graph)
 Constructor. More...
 
CGraphgetGraph (void) const
 Returns the reference to the graph. More...
 

Private Attributes

CGraphm_graph
 The graph. More...
 

Detailed Description

Base abstract class for random model decoding.

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 17 of file Decode.h.

Constructor & Destructor Documentation

◆ CDecode()

DirectGraphicalModels::CDecode::CDecode ( CGraph graph)
inlineprotected

Constructor.

Parameters
graphThe graph

Definition at line 24 of file Decode.h.

◆ ~CDecode()

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

Definition at line 28 of file Decode.h.

Member Function Documentation

◆ decode() [1/2]

virtual vec_byte_t DirectGraphicalModels::CDecode::decode ( Mat &  lossMatrix = EmptyMat) const
inlinevirtual

Approximate decoding.

This function estimates the most probable configuration of states (classes) in the graph, based on marginal probabilities in graph nodes.

Parameters
lossMatrix(optional) The loss matrix \(L\) (size: nStates x nStates; type: CV_32FC1). It must be a quadratic zero-diagonal matrix, whith all non-diagonal elements \(L_{i,j} > 0, \forall i\neq j\). The elemets \(L_{i,j}\) represent a loss if state \(j\) is classified as a state \(i\).
Returns
The most probable configuration

Reimplemented in DirectGraphicalModels::CDecodeExact.

Definition at line 38 of file Decode.h.

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

◆ decode() [2/2]

vec_byte_t DirectGraphicalModels::CDecode::decode ( const CGraph graph,
Mat &  lossMatrix = EmptyMat 
)
static

Approximate decoding.

This function estimates the most probable configuration of states (classes) in the graph, based on marginal probabilities in graph nodes.

Parameters
graphThe graph
lossMatrix(optional) The loss matrix \(L\) (size: nStates x nStates; type: CV_32FC1). It must be a quadratic zero-diagonal matrix, whith all non-diagonal elements \(L_{i,j} > 0, \forall i\neq j\). The elemets \(L_{i,j}\) represent a loss if state \(j\) is classified as a state \(i\).
Returns
The most probable configuration

Definition at line 7 of file Decode.cpp.

Here is the call graph for this function:

◆ getDefaultLossMatrix()

Mat DirectGraphicalModels::CDecode::getDefaultLossMatrix ( byte  nStates)
static

Returns a default loss matrix \(L\).

Parameters
nStatesThe number of States (classes)
Returns
a loss matrix \(nStates\times nStates\): \(L=\left\{\begin{array}{rl}0&\mbox{if i = j}\\ 1&\mbox{otherwise}\end{array}\right.\) (size: nStates x nStates; type: CV_32FC1).
Note
Resulting loss matrix will cause no effect when using inside the decode() function. This function provides only a default matrix for further user modification before using in the decode() function.

Definition at line 28 of file Decode.cpp.

◆ getGraph()

CGraph& DirectGraphicalModels::CDecode::getGraph ( void  ) const
inlineprotected

Returns the reference to the graph.

Returns
The reference to the graph

Definition at line 66 of file Decode.h.

Here is the caller graph for this function:

Member Data Documentation

◆ m_graph

CGraph& DirectGraphicalModels::CDecode::m_graph
private

The graph.

Definition at line 70 of file Decode.h.


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