Exact inference algorithm using brute force enumeration (mainly useful for testing purposes)
More...
|
|
| ExactInf () |
| Default constructor. More...
|
|
| ExactInf (const FactorGraph &fg, const PropertySet &opts) |
| Construct from FactorGraph fg and PropertySet opts. More...
|
|
|
virtual ExactInf * | clone () const |
| Returns a pointer to a new, cloned copy of *this (i.e., virtual copy constructor) More...
|
|
virtual ExactInf * | construct (const FactorGraph &fg, const PropertySet &opts) const |
| Returns a pointer to a newly constructed inference algorithm. More...
|
|
virtual std::string | name () const |
| Returns the name of the algorithm. More...
|
|
virtual Factor | belief (const Var &v) const |
| Returns the (approximate) marginal probability distribution of a variable. More...
|
|
virtual Factor | belief (const VarSet &vs) const |
| Returns the (approximate) marginal probability distribution of a set of variables. More...
|
|
virtual Factor | beliefV (size_t i) const |
| Returns the (approximate) marginal probability distribution of the variable with index i. More...
|
|
virtual Factor | beliefF (size_t I) const |
| Returns the (approximate) marginal probability distribution of the variables on which factor I depends. More...
|
|
virtual std::vector< Factor > | beliefs () const |
| Returns all beliefs (approximate marginal probability distributions) calculated by the algorithm. More...
|
|
virtual Real | logZ () const |
| Returns the logarithm of the (approximated) partition sum (normalizing constant of the factor graph). More...
|
|
std::vector< size_t > | findMaximum () const |
|
virtual void | init () |
| Initializes all data structures of the approximate inference algorithm. More...
|
|
virtual void | init (const VarSet &) |
| Initializes all data structures corresponding to some set of variables. More...
|
|
virtual Real | run () |
| Runs the approximate inference algorithm. More...
|
|
virtual Real | maxDiff () const |
| Returns maximum difference between single variable beliefs in the last iteration. More...
|
|
virtual size_t | Iterations () const |
| Returns number of iterations done (one iteration passes over the complete factorgraph). More...
|
|
virtual void | setProperties (const PropertySet &opts) |
| Set parameters of this inference algorithm. More...
|
|
virtual PropertySet | getProperties () const |
| Returns parameters of this inference algorithm converted into a PropertySet. More...
|
|
virtual std::string | printProperties () const |
| Returns parameters of this inference algorithm formatted as a string in the format "[key1=val1,key2=val2,...,keyn=valn]". More...
|
|
|
Factor | calcMarginal (const VarSet &vs) const |
| Calculates marginal probability distribution for variables vs. More...
|
|
| DAIAlg () |
| Default constructor. More...
|
|
| DAIAlg (const GRM &grm) |
| Construct from GRM. More...
|
|
FactorGraph & | fg () |
| Returns reference to underlying FactorGraph. More...
|
|
const FactorGraph & | fg () const |
| Returns constant reference to underlying FactorGraph. More...
|
|
void | clamp (size_t i, size_t x, bool backup=false) |
| Clamp variable with index i to value x (i.e. multiply with a Kronecker delta ) More...
|
|
void | makeCavity (size_t i, bool backup=false) |
| Sets all factors interacting with variable with index i to one. More...
|
|
void | makeRegionCavity (std::vector< size_t > facInds, bool backup) |
| Sets all factors indicated by facInds to one. More...
|
|
void | backupFactor (size_t I) |
| Make a backup copy of factor I. More...
|
|
void | backupFactors (const VarSet &vs) |
| Make backup copies of all factors involving the variables in vs. More...
|
|
void | restoreFactor (size_t I) |
| Restore factor I from its backup copy. More...
|
|
void | restoreFactors (const VarSet &vs) |
| Restore the factors involving the variables in vs from their backup copies. More...
|
|
void | restoreFactors () |
| Restore all factors from their backup copies. More...
|
|
virtual | ~InfAlg () |
| Virtual destructor (needed because this class contains virtual functions) More...
|
|
virtual std::string | identify () const |
| Identifies itself for logging purposes. More...
|
|
virtual void | setMaxIter (size_t) |
| Sets maximum number of iterations (one iteration passes over the complete factorgraph). More...
|
|
Exact inference algorithm using brute force enumeration (mainly useful for testing purposes)
Inference is done simply by multiplying all factors together into one large factor, and then calculating marginals and partition sum from the product.
- Note
- This inference method can easily exhaust all available memory; in that case, one may try the JTree class instead.