dai::TreeEP Class Reference

Approximate inference algorithm "Tree Expectation Propagation" [MiQ04]. More...

#include <dai/treeep.h>

Inheritance diagram for dai::TreeEP:

dai::JTree dai::DAIAlg< GRM > dai::InfAlg

List of all members.

Public Member Functions

 TreeEP ()
 Default constructor.
 TreeEP (const TreeEP &x)
 Copy constructor.
TreeEPoperator= (const TreeEP &x)
 Assignment operator.
 TreeEP (const FactorGraph &fg, const PropertySet &opts)
 Construct from FactorGraph fg and PropertySet opts.
General InfAlg interface
virtual TreeEPclone () const
 Returns a pointer to a new, cloned copy of *this (i.e., virtual copy constructor).
virtual std::string identify () const
 Identifies itself for logging purposes.
virtual Real logZ () const
 Returns the logarithm of the (approximated) partition sum (normalizing constant of the factor graph).
virtual void init ()
 Initializes all data structures of the approximate inference algorithm.
virtual void init (const VarSet &)
 Initializes all data structures corresponding to some set of variables.
virtual Real run ()
 Runs the approximate inference algorithm.
virtual Real maxDiff () const
 Returns maximum difference between single variable beliefs in the last iteration.
virtual size_t Iterations () const
 Returns number of iterations done (one iteration passes over the complete factorgraph).
virtual void setMaxIter (size_t maxiter)
 Sets maximum number of iterations (one iteration passes over the complete factorgraph).
virtual void setProperties (const PropertySet &opts)
 Set parameters of this inference algorithm.
virtual PropertySet getProperties () const
 Returns parameters of this inference algorithm converted into a PropertySet.
virtual std::string printProperties () const
 Returns parameters of this inference algorithm formatted as a string in the format "[key1=val1,key2=val2,...,keyn=valn]".

Public Attributes

struct dai::TreeEP::Properties props

Static Public Attributes

static const char * Name = "TREEEP"
 Name of this inference method.

Private Member Functions

void construct (const FactorGraph &fg, const RootedTree &tree)
 Helper function for constructors.
bool offtree (size_t I) const
 Returns true if factor I is not part of the tree.

Private Attributes

Real _maxdiff
 Maximum difference encountered so far.
size_t _iters
 Number of iterations needed.
std::map< size_t, TreeEPSubTree_Q
 Stores a TreeEPSubTree object for each off-tree factor.

Classes

struct  Properties
 Parameters for TreeEP. More...
class  TreeEPSubTree
 Stores the data structures needed to efficiently update the approximation of an off-tree factor. More...


Detailed Description

Approximate inference algorithm "Tree Expectation Propagation" [MiQ04].

Constructor & Destructor Documentation

dai::TreeEP::TreeEP (  )  [inline]

Default constructor.

dai::TreeEP::TreeEP ( const TreeEP x  )  [inline]

Copy constructor.

dai::TreeEP::TreeEP ( const FactorGraph fg,
const PropertySet opts 
)

Construct from FactorGraph fg and PropertySet opts.

Parameters:
fg Factor graph.
opts Parameters
See also:
Properties


Member Function Documentation

TreeEP& dai::TreeEP::operator= ( const TreeEP x  )  [inline]

Assignment operator.

virtual TreeEP* dai::TreeEP::clone (  )  const [inline, virtual]

Returns a pointer to a new, cloned copy of *this (i.e., virtual copy constructor).

Reimplemented from dai::JTree.

string dai::TreeEP::identify (  )  const [virtual]

Identifies itself for logging purposes.

Reimplemented from dai::JTree.

Real dai::TreeEP::logZ (  )  const [virtual]

Returns the logarithm of the (approximated) partition sum (normalizing constant of the factor graph).

Note:
Before this method is called, run() should have been called.
Exceptions:
NOT_IMPLEMENTED if not implemented/supported

Reimplemented from dai::JTree.

void dai::TreeEP::init (  )  [virtual]

Initializes all data structures of the approximate inference algorithm.

Note:
This method should be called at least once before run() is called.

Reimplemented from dai::JTree.

virtual void dai::TreeEP::init ( const VarSet vs  )  [inline, virtual]

Initializes all data structures corresponding to some set of variables.

This method can be used to do a partial initialization after a part of the factor graph has changed. Instead of initializing all data structures, it only initializes those involving the variables in vs.

Exceptions:
NOT_IMPLEMENTED if not implemented/supported

Reimplemented from dai::JTree.

Real dai::TreeEP::run (  )  [virtual]

Runs the approximate inference algorithm.

Note:
Before run() is called the first time, init() should have been called.

Reimplemented from dai::JTree.

virtual Real dai::TreeEP::maxDiff (  )  const [inline, virtual]

Returns maximum difference between single variable beliefs in the last iteration.

Exceptions:
NOT_IMPLEMENTED if not implemented/supported

Reimplemented from dai::JTree.

virtual size_t dai::TreeEP::Iterations (  )  const [inline, virtual]

Returns number of iterations done (one iteration passes over the complete factorgraph).

Exceptions:
NOT_IMPLEMENTED if not implemented/supported

Reimplemented from dai::JTree.

virtual void dai::TreeEP::setMaxIter ( size_t   )  [inline, virtual]

Sets maximum number of iterations (one iteration passes over the complete factorgraph).

Exceptions:
NOT_IMPLEMENTED if not implemented/supported

Reimplemented from dai::InfAlg.

void dai::TreeEP::setProperties ( const PropertySet opts  )  [virtual]

Set parameters of this inference algorithm.

The parameters are set according to the PropertySet opts. The values can be stored either as std::string or as the type of the corresponding MF::props member.

Reimplemented from dai::JTree.

PropertySet dai::TreeEP::getProperties (  )  const [virtual]

Returns parameters of this inference algorithm converted into a PropertySet.

Reimplemented from dai::JTree.

string dai::TreeEP::printProperties (  )  const [virtual]

Returns parameters of this inference algorithm formatted as a string in the format "[key1=val1,key2=val2,...,keyn=valn]".

Reimplemented from dai::JTree.

void dai::TreeEP::construct ( const FactorGraph fg,
const RootedTree tree 
) [private]

Helper function for constructors.

bool dai::TreeEP::offtree ( size_t  I  )  const [inline, private]

Returns true if factor I is not part of the tree.


Member Data Documentation

Maximum difference encountered so far.

size_t dai::TreeEP::_iters [private]

Number of iterations needed.

const char * dai::TreeEP::Name = "TREEEP" [static]

Name of this inference method.

Reimplemented from dai::JTree.

std::map<size_t, TreeEPSubTree> dai::TreeEP::_Q [private]

Stores a TreeEPSubTree object for each off-tree factor.


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

Generated on Thu Aug 5 19:04:08 2010 for libDAI by  doxygen 1.5.5