Calculates both types of BP messages and their normalizers from an InfAlg.
More...
#include <dai/bp_dual.h>
Classes |
struct | _edges_t |
| Convenience label for storing edge properties. More...
|
struct | beliefs |
| Groups together the data structures for storing the two types of beliefs and their normalizers. More...
|
struct | messages |
| Groups together the data structures for storing the two types of messages and their normalizers. More...
|
Public Member Functions |
| BP_dual (const InfAlg *ia) |
| Construct BP_dual object from (converged) InfAlg object's beliefs and factors.
|
const FactorGraph & | fg () const |
| Returns the underlying FactorGraph.
|
Prob & | msgM (size_t i, size_t _I) |
| Returns reference to factor->variable message (I -> i)
|
const Prob & | msgM (size_t i, size_t _I) const |
| Returns constant reference to factor->variable message (I -> i)
|
Prob & | msgN (size_t i, size_t _I) |
| Returns reference to variable -> factor message (i -> I)
|
const Prob & | msgN (size_t i, size_t _I) const |
| Returns constant reference to variable -> factor message (i -> I)
|
Real & | zM (size_t i, size_t _I) |
| Returns reference to normalizer for factor->variable message (I -> i)
|
const Real & | zM (size_t i, size_t _I) const |
| Returns constant reference to normalizer for factor->variable message (I -> i)
|
Real & | zN (size_t i, size_t _I) |
| Returns reference to normalizer for variable -> factor message (i -> I)
|
const Real & | zN (size_t i, size_t _I) const |
| Returns constant reference to normalizer for variable -> factor message (i -> I)
|
Factor | beliefV (size_t i) const |
| Returns belief of variable i.
|
Factor | beliefF (size_t I) const |
| Returns belief of factor I.
|
Real | beliefVZ (size_t i) const |
| Returns normalizer for belief of variable i.
|
Real | beliefFZ (size_t I) const |
| Returns normalizer for belief of factor I.
|
Protected Member Functions |
void | init () |
| Does all necessary preprocessing.
|
void | regenerateMessages () |
| Allocates space for _msgs.
|
void | regenerateBeliefs () |
| Allocates space for _beliefs.
|
void | calcMessages () |
| Calculate all messages from InfAlg beliefs.
|
void | calcNewM (size_t i, size_t _I) |
| Update factor->variable message (i -> I)
|
void | calcNewN (size_t i, size_t _I) |
| Update variable->factor message (I -> i)
|
void | calcBeliefs () |
| Calculate all variable and factor beliefs from messages.
|
void | calcBeliefV (size_t i) |
| Calculate belief of variable i.
|
void | calcBeliefF (size_t I) |
| Calculate belief of factor I.
|
Detailed Description
Calculates both types of BP messages and their normalizers from an InfAlg.
BP_dual calculates "dual" versions of BP messages (both messages from factors to variables and messages from variables to factors), and normalizers, given an InfAlg. These are computed from the variable and factor beliefs of the InfAlg. This class is used primarily by BBP.
- Author
- Frederik Eaton
Constructor & Destructor Documentation
dai::BP_dual::BP_dual |
( |
const InfAlg * |
ia | ) |
|
|
inline |
Construct BP_dual object from (converged) InfAlg object's beliefs and factors.
- Warning
- A pointer to the the InfAlg object is stored, so the object must not be destroyed before the BP_dual is destroyed.
Member Function Documentation
void dai::BP_dual::init |
( |
| ) |
|
|
protected |
Does all necessary preprocessing.
void dai::BP_dual::regenerateMessages |
( |
| ) |
|
|
protected |
Allocates space for _msgs.
void dai::BP_dual::regenerateBeliefs |
( |
| ) |
|
|
protected |
Allocates space for _beliefs.
void dai::BP_dual::calcMessages |
( |
| ) |
|
|
protected |
Calculate all messages from InfAlg beliefs.
void dai::BP_dual::calcNewM |
( |
size_t |
i, |
|
|
size_t |
_I |
|
) |
| |
|
protected |
Update factor->variable message (i -> I)
void dai::BP_dual::calcNewN |
( |
size_t |
i, |
|
|
size_t |
_I |
|
) |
| |
|
protected |
Update variable->factor message (I -> i)
void dai::BP_dual::calcBeliefs |
( |
| ) |
|
|
protected |
Calculate all variable and factor beliefs from messages.
void dai::BP_dual::calcBeliefV |
( |
size_t |
i | ) |
|
|
protected |
Calculate belief of variable i.
void dai::BP_dual::calcBeliefF |
( |
size_t |
I | ) |
|
|
protected |
Calculate belief of factor I.
Prob& dai::BP_dual::msgM |
( |
size_t |
i, |
|
|
size_t |
_I |
|
) |
| |
|
inline |
Returns reference to factor->variable message (I -> i)
const Prob& dai::BP_dual::msgM |
( |
size_t |
i, |
|
|
size_t |
_I |
|
) |
| const |
|
inline |
Returns constant reference to factor->variable message (I -> i)
Prob& dai::BP_dual::msgN |
( |
size_t |
i, |
|
|
size_t |
_I |
|
) |
| |
|
inline |
Returns reference to variable -> factor message (i -> I)
const Prob& dai::BP_dual::msgN |
( |
size_t |
i, |
|
|
size_t |
_I |
|
) |
| const |
|
inline |
Returns constant reference to variable -> factor message (i -> I)
Real& dai::BP_dual::zM |
( |
size_t |
i, |
|
|
size_t |
_I |
|
) |
| |
|
inline |
Returns reference to normalizer for factor->variable message (I -> i)
const Real& dai::BP_dual::zM |
( |
size_t |
i, |
|
|
size_t |
_I |
|
) |
| const |
|
inline |
Returns constant reference to normalizer for factor->variable message (I -> i)
Real& dai::BP_dual::zN |
( |
size_t |
i, |
|
|
size_t |
_I |
|
) |
| |
|
inline |
Returns reference to normalizer for variable -> factor message (i -> I)
const Real& dai::BP_dual::zN |
( |
size_t |
i, |
|
|
size_t |
_I |
|
) |
| const |
|
inline |
Returns constant reference to normalizer for variable -> factor message (i -> I)
Factor dai::BP_dual::beliefV |
( |
size_t |
i | ) |
const |
|
inline |
Returns belief of variable i.
Factor dai::BP_dual::beliefF |
( |
size_t |
I | ) |
const |
|
inline |
Returns belief of factor I.
Real dai::BP_dual::beliefVZ |
( |
size_t |
i | ) |
const |
|
inline |
Returns normalizer for belief of variable i.
Real dai::BP_dual::beliefFZ |
( |
size_t |
I | ) |
const |
|
inline |
Returns normalizer for belief of factor I.
Member Data Documentation
const InfAlg* dai::BP_dual::_ia |
|
protected |
The documentation for this class was generated from the following files: