Base abstract class for random model inference.
More...
#include <Infer.h>
Base abstract class for random model inference.
- 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 19 of file Infer.h.
◆ CInfer() [1/2]
DirectGraphicalModels::CInfer::CInfer |
( |
CGraph & |
graph | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 26 of file Infer.h.
◆ CInfer() [2/2]
DirectGraphicalModels::CInfer::CInfer |
( |
const CInfer & |
| ) |
|
|
delete |
◆ ~CInfer()
virtual DirectGraphicalModels::CInfer::~CInfer |
( |
| ) |
|
|
virtualdefault |
◆ decode()
vec_byte_t DirectGraphicalModels::CInfer::decode |
( |
unsigned int |
nIt = 0 , |
|
|
Mat & |
lossMatrix = EmptyMat |
|
) |
| |
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
- Parameters
-
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\). |
- Returns
- The most probable configuration
- Note
- 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, which corresponds to the configuration with the highest joint probability. In other words:
Definition at line 7 of file Infer.cpp.
◆ getConfidence()
vec_float_t DirectGraphicalModels::CInfer::getConfidence |
( |
void |
| ) |
const |
Returns the confidence of the perdiction.
This function calculates the confidence values for the predicted states (classes) in the graph via CInfer::decode(). The confidence values lie in range [0; 1].
- Returns
- The confidence values for each node of graph.
Definition at line 13 of file Infer.cpp.
◆ getGraph()
CGraph& DirectGraphicalModels::CInfer::getGraph |
( |
void |
| ) |
const |
|
inlineprotected |
Returns the reference to the graph.
- Returns
- The reference to the graph
Definition at line 82 of file Infer.h.
◆ getPotentials()
vec_float_t DirectGraphicalModels::CInfer::getPotentials |
( |
byte |
state | ) |
const |
Returns the potnetials for the selected state (class)
- Parameters
-
state | The state (class) of interest |
- Returns
- The potential values for each node of the graph.
Definition at line 33 of file Infer.cpp.
◆ infer()
virtual void DirectGraphicalModels::CInfer::infer |
( |
unsigned int |
nIt = 1 | ) |
|
|
pure virtual |
◆ operator=()
const CInfer& DirectGraphicalModels::CInfer::operator= |
( |
const CInfer & |
| ) |
|
|
delete |
◆ m_graph
CGraph& DirectGraphicalModels::CInfer::m_graph |
|
private |
The documentation for this class was generated from the following files: