libDAI
|
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... | |
TreeEPSubTree & | operator= (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 in [MiQ04]) More... | |
std::vector< Factor > | _Qb |
Inner region pseudomarginals (corresponding with the 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... | |
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.
|
inline |
Default constructor.
|
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.
|
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.
|
inline |
Returns constant reference to the pointer to the off-tree factor.
|
private |
Outer region pseudomarginals (corresponding with the in [MiQ04])
|
private |
Inner region pseudomarginals (corresponding with the in [MiQ04])
|
private |
The junction tree (stored as a rooted tree)
|
private |
Index conversion table for outer region indices (_Qa[alpha] corresponds with Qa[_a[alpha]] of the supertree)
|
private |
Index conversion table for inner region indices (_Qb[beta] corresponds with Qb[_b[beta]] of the supertree)
|
private |
Pointer to off-tree factor.
|
private |
Variables in off-tree factor.
|
private |
Variables in off-tree factor which are not in the root of this subtree.
|
private |
Used for calculating the free energy.