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

Sum product Loopy Belief Propagation inference class. More...

#include <InferLBP.h>

Inheritance diagram for DirectGraphicalModels::CInferLBP:
Collaboration diagram for DirectGraphicalModels::CInferLBP:

Public Member Functions

 CInferLBP (CGraphPairwise &graph)
 Constructor. More...
 
virtual ~CInferLBP (void)
 
- Public Member Functions inherited from DirectGraphicalModels::CMessagePassing
 CMessagePassing (CGraphPairwise &graph)
 Constructor. More...
 
virtual ~CMessagePassing (void)
 
virtual void infer (unsigned int nIt=1)
 Inference. More...
 
- Public Member Functions inherited from DirectGraphicalModels::CInfer
 CInfer (CGraph &graph)
 Constructor. More...
 
 CInfer (const CInfer &)=delete
 
virtual ~CInfer ()=default
 
const CInferoperator= (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...
 

Protected Member Functions

virtual void calculateMessages (unsigned int nIt)
 Calculates messages, associated with the edges of corresponding graphical model. More...
 
void setMaxSum (bool maxSum)
 
bool isMaxSum (void) const
 
- Protected Member Functions inherited from DirectGraphicalModels::CMessagePassing
CGraphPairwisegetGraphPairwise (void) const
 Returns the graph. More...
 
void calculateMessage (Edge *edge, float *temp, float *&dst, bool maxSum=false)
 Calculates one message for the specified edge edge. More...
 
void createMessages (void)
 Allocates memory for Edge::msg and Edge::msg_temp containers for all edges in the graph. More...
 
void deleteMessages (void)
 Deletes memory for Edge::msg and Edge::msg_temp containers for all edges in the graph. More...
 
void swapMessages (void)
 Swaps Edge::msg and Edge::msg_temp for all edges in the graph. More...
 
- Protected Member Functions inherited from DirectGraphicalModels::CInfer
CGraphgetGraph (void) const
 Returns the reference to the graph. More...
 

Private Attributes

bool m_maxSum
 Flag indicating weather the max-sum LBP (Viterbi algorithm) should be applied. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from DirectGraphicalModels::CMessagePassing
static float MatMul (const Mat &M, const float *v, float *&dst, bool maxSum=false)
 Specific matrix multiplication. More...
 

Detailed Description

Sum product Loopy Belief Propagation inference class.

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 InferLBP.h.

Constructor & Destructor Documentation

◆ CInferLBP()

DirectGraphicalModels::CInferLBP::CInferLBP ( CGraphPairwise graph)
inline

Constructor.

Parameters
graphThe graph

Definition at line 23 of file InferLBP.h.

◆ ~CInferLBP()

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

Definition at line 24 of file InferLBP.h.

Member Function Documentation

◆ calculateMessages()

void DirectGraphicalModels::CInferLBP::calculateMessages ( unsigned int  nIt)
protectedvirtual

Calculates messages, associated with the edges of corresponding graphical model.

This function may modify Edge::msg and Edge::msg_temp containers of graph edges

Parameters
nItNumber of iterations

Implements DirectGraphicalModels::CMessagePassing.

Definition at line 6 of file InferLBP.cpp.

Here is the call graph for this function:

◆ isMaxSum()

bool DirectGraphicalModels::CInferLBP::isMaxSum ( void  ) const
inlineprotected

Definition at line 30 of file InferLBP.h.

◆ setMaxSum()

void DirectGraphicalModels::CInferLBP::setMaxSum ( bool  maxSum)
inlineprotected

Definition at line 29 of file InferLBP.h.

Here is the caller graph for this function:

Member Data Documentation

◆ m_maxSum

bool DirectGraphicalModels::CInferLBP::m_maxSum
private

Flag indicating weather the max-sum LBP (Viterbi algorithm) should be applied.

Definition at line 34 of file InferLBP.h.


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