Direct Graphical Models
v.1.7.0
|
Exact inference class. More...
#include <InferExact.h>
Public Member Functions | |
CInferExact (IGraphPairwise &graph) | |
Constructor. More... | |
virtual | ~CInferExact (void)=default |
virtual void | infer (unsigned int nIt=0) |
Exact inference. More... | |
vec_byte_t | decode (unsigned int nIt=0, Mat &lossMatrix=EmptyMat) |
Approximate decoding. More... | |
Public Member Functions inherited from DirectGraphicalModels::CInfer | |
CInfer (CGraph &graph) | |
Constructor. More... | |
CInfer (const CInfer &)=delete | |
virtual | ~CInfer ()=default |
const CInfer & | operator= (const CInfer &)=delete |
vec_byte_t | decode (unsigned int nIt=0, Mat &lossMatrix=EmptyMat) |
Approximate decoding. More... | |
vec_float_t | getConfidence (void) const |
Returns the confidence of the perdiction. 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::CInfer | |
CGraph & | getGraph (void) const |
Returns the reference to the graph. More... | |
Private Member Functions inherited from DirectGraphicalModels::CDecodeExact | |
CDecodeExact (IGraphPairwise &graph) | |
Constructor. More... | |
virtual | ~CDecodeExact (void) |
virtual vec_byte_t | decode (Mat &lossMatrix=EmptyMat) const |
Exact decoding. More... | |
IGraphPairwise & | getGraphPairwise (void) const |
Returns the graph. 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... | |
Private Member Functions inherited from DirectGraphicalModels::CDecode | |
virtual | ~CDecode (void) |
CDecode (CGraph &graph) | |
Constructor. More... | |
CGraph & | getGraph (void) const |
Returns the reference to the graph. More... | |
Static Private Member Functions inherited from DirectGraphicalModels::CDecode | |
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... | |
Exact inference class.
Definition at line 17 of file InferExact.h.
|
inline |
|
virtualdefault |
vec_byte_t DirectGraphicalModels::CInfer::decode |
Approximate decoding.
This function calls first inference infer() and then, using resulting marginal probabilities, estimates the most probable configuration of states (classes) in the graph via CDecode::decode().
This function modifies Node::Pot containers of graph nodes
nIt | Number of iterations |
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\). |
|
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:
nIt | is not used |
Implements DirectGraphicalModels::CInfer.
Definition at line 7 of file InferExact.cpp.