cc.mallet.grmm.inference
Interface Inferencer

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractBeliefPropagation, AbstractInferencer, BruteForceInferencer, JunctionTreeInferencer, LoopyBP, ParentChildGBP, ResidualBP, SamplingInferencer, TreeBP, TRP, VariableElimination

public interface Inferencer
extends java.io.Serializable

Interface implemented by all inferencers, which are algorithms for computing (perhaps approximately) marginal distributions over nodes in the model.

If you are implementing a new inferencer, you may wish to consider subclassing AbstractInferencer, which implements this interface.

Created: Wed Oct 1 11:18:09 2003

Version:
$Id: Inferencer.java,v 1.1 2007/10/22 21:37:49 mccallum Exp $
Author:
Charles Sutton

Method Summary
 void computeMarginals(FactorGraph mdl)
          Computes marginal distributions for a factor graph.
 void dump()
           
 Inferencer duplicate()
           
 double lookupJoint(Assignment assn)
          Returns the joint probability of a given assignment, computed in some factorized fashion.
 double lookupLogJoint(Assignment assn)
          Returns the natural logarithm of the joint probability of a given assignment, computed in some factorized fashion.
 Factor lookupMarginal(Variable v)
          Returns the computed marginal of a given variable.
 Factor lookupMarginal(VarSet varSet)
          Returns the computed marginal of a given clique in a graph.
 double query(FactorGraph mdl, Assignment assn)
          Computes the marginal probability of a given assignment to a small number of model variables.
 void reportTime()
          Outputs some measure of the total time spent in this inferencer.
 

Method Detail

computeMarginals

void computeMarginals(FactorGraph mdl)
Computes marginal distributions for a factor graph.

Throws:
java.lang.UnsupportedOperationException - If this inferencer does not support undirected models (unlikely).

lookupMarginal

Factor lookupMarginal(Variable v)
Returns the computed marginal of a given variable. Before using this method, computeMarginals must have been previously called on the graphical model that contains v.

See Also:
computeMarginals(FactorGraph)

lookupMarginal

Factor lookupMarginal(VarSet varSet)
Returns the computed marginal of a given clique in a graph. Before using this method, computeMarginals must have been previously called on the graphical model that contains the clique.

Throws:
java.lang.UnsupportedOperationException - If this inferencer does not compute marginals for the size of clique given.
See Also:
computeMarginals(cc.mallet.grmm.types.FactorGraph), #computeMarginals(JunctionTree)

lookupJoint

double lookupJoint(Assignment assn)
Returns the joint probability of a given assignment, computed in some factorized fashion. Before using this method, computeMarginals must have been previously called on the graphical model that contains the variables of assn.

See Also:
computeMarginals(cc.mallet.grmm.types.FactorGraph), #computeMarginals(JunctionTree)

lookupLogJoint

double lookupLogJoint(Assignment assn)
Returns the natural logarithm of the joint probability of a given assignment, computed in some factorized fashion. Before using this method, computeMarginals must have been previously called on the graphical model that contains the variables of assn.

This method is less likely to underflow than Math.log (lookupJoint (assn)).

See Also:
computeMarginals(cc.mallet.grmm.types.FactorGraph), #computeMarginals(JunctionTree)

query

double query(FactorGraph mdl,
             Assignment assn)
Computes the marginal probability of a given assignment to a small number of model variables. This may require one run of computeMarginals() for each variable in the assignment; if the assigment has many variables, it may be more efficient to use lookupJoint.


duplicate

Inferencer duplicate()

dump

void dump()

reportTime

void reportTime()
Outputs some measure of the total time spent in this inferencer.