cc.mallet.grmm.inference
Class BruteForceInferencer

java.lang.Object
  extended by cc.mallet.grmm.inference.AbstractInferencer
      extended by cc.mallet.grmm.inference.BruteForceInferencer
All Implemented Interfaces:
Inferencer, java.io.Serializable, java.lang.Cloneable

public class BruteForceInferencer
extends AbstractInferencer
implements Inferencer

Computes the joint of a GraphicalModel by brute-force calculation. This is exponentially slow, so it is mostly useful as a sanity check on more complicated algorithms. Created: Wed Sep 17 13:21:13 2003

Version:
$Id: BruteForceInferencer.java,v 1.1 2007/10/22 21:37:49 mccallum Exp $
Author:
Charles Sutton
See Also:
Serialized Form

Constructor Summary
BruteForceInferencer()
           
 
Method Summary
 void computeMarginals(FactorGraph mdl)
          Computes marginal distributions for a factor graph.
 void computeMarginals(JunctionTree jt)
           
 Factor joint(FactorGraph model)
           
 Factor joint(JunctionTree jt)
           
 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 var)
          Returns the computed marginal of a given variable.
 Factor lookupMarginal(VarSet c)
          Returns the computed marginal of a given clique in a graph.
 
Methods inherited from class cc.mallet.grmm.inference.AbstractInferencer
dump, duplicate, query, reportTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cc.mallet.grmm.inference.Inferencer
dump, duplicate, query, reportTime
 

Constructor Detail

BruteForceInferencer

public BruteForceInferencer()
Method Detail

joint

public Factor joint(FactorGraph model)

joint

public Factor joint(JunctionTree jt)

computeMarginals

public void computeMarginals(FactorGraph mdl)
Description copied from interface: Inferencer
Computes marginal distributions for a factor graph.

Specified by:
computeMarginals in interface Inferencer
Specified by:
computeMarginals in class AbstractInferencer

computeMarginals

public void computeMarginals(JunctionTree jt)

lookupMarginal

public Factor lookupMarginal(Variable var)
Description copied from interface: Inferencer
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.

Specified by:
lookupMarginal in interface Inferencer
Specified by:
lookupMarginal in class AbstractInferencer
See Also:
Inferencer.computeMarginals(FactorGraph)

lookupMarginal

public Factor lookupMarginal(VarSet c)
Description copied from interface: Inferencer
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.

Specified by:
lookupMarginal in interface Inferencer
Overrides:
lookupMarginal in class AbstractInferencer
See Also:
Inferencer.computeMarginals(cc.mallet.grmm.types.FactorGraph), #computeMarginals(JunctionTree)

lookupJoint

public double lookupJoint(Assignment assn)
Description copied from interface: Inferencer
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.

Specified by:
lookupJoint in interface Inferencer
Overrides:
lookupJoint in class AbstractInferencer
See Also:
Inferencer.computeMarginals(cc.mallet.grmm.types.FactorGraph), #computeMarginals(JunctionTree)

lookupLogJoint

public double lookupLogJoint(Assignment assn)
Description copied from interface: Inferencer
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)).

Specified by:
lookupLogJoint in interface Inferencer
Overrides:
lookupLogJoint in class AbstractInferencer
See Also:
Inferencer.computeMarginals(cc.mallet.grmm.types.FactorGraph), #computeMarginals(JunctionTree)