libDAI
Public Member Functions | Private Attributes | List of all members
dai::TreeEP::TreeEPSubTree Class Reference

Stores the data structures needed to efficiently update the approximation of an off-tree factor. More...

Public Member Functions

void init ()
 Initializes beliefs of this subtree. More...
 
void InvertAndMultiply (const std::vector< Factor > &Qa, const std::vector< Factor > &Qb)
 Inverts this approximation and multiplies it by the (super) junction tree marginals Qa and Qb. More...
 
void HUGIN_with_I (std::vector< Factor > &Qa, std::vector< Factor > &Qb)
 Runs junction tree algorithm (including off-tree factor I) storing the results in the (super) junction tree Qa and Qb. More...
 
Real logZ (const std::vector< Factor > &Qa, const std::vector< Factor > &Qb) const
 Returns energy (?) of this subtree. More...
 
const Factor *& I ()
 Returns constant reference to the pointer to the off-tree factor. More...
 
Constructors/destructors
 TreeEPSubTree ()
 Default constructor. More...
 
 TreeEPSubTree (const TreeEPSubTree &x)
 Copy constructor. More...
 
TreeEPSubTreeoperator= (const TreeEPSubTree &x)
 Assignment operator. More...
 
 TreeEPSubTree (const RootedTree &subRTree, const RootedTree &jt_RTree, const std::vector< Factor > &jt_Qa, const std::vector< Factor > &jt_Qb, const Factor *I)
 Construct from subRTree, which is a subtree of the main tree jt_RTree, with distribution represented by jt_Qa and jt_Qb, for off-tree factor I. More...
 

Private Attributes

std::vector< Factor_Qa
 Outer region pseudomarginals (corresponding with the $\tilde f_i(x_j,x_k)$ in [MiQ04]) More...
 
std::vector< Factor_Qb
 Inner region pseudomarginals (corresponding with the $\tilde f_i(x_s)$ in [MiQ04]) More...
 
RootedTree _RTree
 The junction tree (stored as a rooted tree) More...
 
std::vector< size_t > _a
 Index conversion table for outer region indices (_Qa[alpha] corresponds with Qa[_a[alpha]] of the supertree) More...
 
std::vector< size_t > _b
 Index conversion table for inner region indices (_Qb[beta] corresponds with Qb[_b[beta]] of the supertree) More...
 
const Factor_I
 Pointer to off-tree factor. More...
 
VarSet _ns
 Variables in off-tree factor. More...
 
VarSet _nsrem
 Variables in off-tree factor which are not in the root of this subtree. More...
 
Real _logZ
 Used for calculating the free energy. More...
 

Detailed Description

Stores the data structures needed to efficiently update the approximation of an off-tree factor.

The TreeEP object stores a TreeEPSubTree object for each off-tree factor. It stores the approximation of that off-tree factor, which is represented as a distribution on a subtree of the main tree.

Constructor & Destructor Documentation

dai::TreeEP::TreeEPSubTree::TreeEPSubTree ( )
inline

Default constructor.

dai::TreeEP::TreeEPSubTree::TreeEPSubTree ( const TreeEPSubTree x)
inline

Copy constructor.

dai::TreeEP::TreeEPSubTree::TreeEPSubTree ( const RootedTree subRTree,
const RootedTree jt_RTree,
const std::vector< Factor > &  jt_Qa,
const std::vector< Factor > &  jt_Qb,
const Factor I 
)

Construct from subRTree, which is a subtree of the main tree jt_RTree, with distribution represented by jt_Qa and jt_Qb, for off-tree factor I.

Member Function Documentation

TreeEPSubTree& dai::TreeEP::TreeEPSubTree::operator= ( const TreeEPSubTree x)
inline

Assignment operator.

void dai::TreeEP::TreeEPSubTree::init ( )

Initializes beliefs of this subtree.

void dai::TreeEP::TreeEPSubTree::InvertAndMultiply ( const std::vector< Factor > &  Qa,
const std::vector< Factor > &  Qb 
)

Inverts this approximation and multiplies it by the (super) junction tree marginals Qa and Qb.

void dai::TreeEP::TreeEPSubTree::HUGIN_with_I ( std::vector< Factor > &  Qa,
std::vector< Factor > &  Qb 
)

Runs junction tree algorithm (including off-tree factor I) storing the results in the (super) junction tree Qa and Qb.

Real dai::TreeEP::TreeEPSubTree::logZ ( const std::vector< Factor > &  Qa,
const std::vector< Factor > &  Qb 
) const

Returns energy (?) of this subtree.

const Factor*& dai::TreeEP::TreeEPSubTree::I ( )
inline

Returns constant reference to the pointer to the off-tree factor.

Member Data Documentation

std::vector<Factor> dai::TreeEP::TreeEPSubTree::_Qa
private

Outer region pseudomarginals (corresponding with the $\tilde f_i(x_j,x_k)$ in [MiQ04])

std::vector<Factor> dai::TreeEP::TreeEPSubTree::_Qb
private

Inner region pseudomarginals (corresponding with the $\tilde f_i(x_s)$ in [MiQ04])

RootedTree dai::TreeEP::TreeEPSubTree::_RTree
private

The junction tree (stored as a rooted tree)

std::vector<size_t> dai::TreeEP::TreeEPSubTree::_a
private

Index conversion table for outer region indices (_Qa[alpha] corresponds with Qa[_a[alpha]] of the supertree)

std::vector<size_t> dai::TreeEP::TreeEPSubTree::_b
private

Index conversion table for inner region indices (_Qb[beta] corresponds with Qb[_b[beta]] of the supertree)

const Factor* dai::TreeEP::TreeEPSubTree::_I
private

Pointer to off-tree factor.

VarSet dai::TreeEP::TreeEPSubTree::_ns
private

Variables in off-tree factor.

VarSet dai::TreeEP::TreeEPSubTree::_nsrem
private

Variables in off-tree factor which are not in the root of this subtree.

Real dai::TreeEP::TreeEPSubTree::_logZ
private

Used for calculating the free energy.


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