Public Member Functions | |
void | init () |
Initializes beliefs of this subtree. | |
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. | |
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. | |
Real | logZ (const std::vector< Factor > &Qa, const std::vector< Factor > &Qb) const |
Returns energy (?) of this subtree. | |
const Factor *& | I () |
Returns constant reference to the pointer to the off-tree factor. | |
Constructors/destructors | |
TreeEPSubTree () | |
Default constructor. | |
TreeEPSubTree (const TreeEPSubTree &x) | |
Copy constructor. | |
TreeEPSubTree & | operator= (const TreeEPSubTree &x) |
Assignment operator. | |
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. | |
Private Attributes | |
std::vector< Factor > | _Qa |
Outer region pseudomarginals (corresponding with the ![]() | |
std::vector< Factor > | _Qb |
Inner region pseudomarginals (corresponding with the ![]() | |
RootedTree | _RTree |
The junction tree (stored as a rooted tree). | |
std::vector< size_t > | _a |
Index conversion table for outer region indices (_Qa[alpha] corresponds with Qa[_a[alpha]] of the supertree). | |
std::vector< size_t > | _b |
Index conversion table for inner region indices (_Qb[beta] corresponds with Qb[_b[beta]] of the supertree). | |
const Factor * | _I |
Pointer to off-tree factor. | |
VarSet | _ns |
Variables in off-tree factor. | |
VarSet | _nsrem |
Variables in off-tree factor which are not in the root of this subtree. | |
Real | _logZ |
Used for calculating the free energy. |
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.
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.
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.
std::vector<Factor> dai::TreeEP::TreeEPSubTree::_Qa [private] |
Outer region pseudomarginals (corresponding with the in [MiQ04]).
std::vector<Factor> dai::TreeEP::TreeEPSubTree::_Qb [private] |
Inner region pseudomarginals (corresponding with the 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.