cc.mallet.grmm.inference
Class ExactSampler

java.lang.Object
  extended by cc.mallet.grmm.inference.ExactSampler
All Implemented Interfaces:
Sampler

public class ExactSampler
extends java.lang.Object
implements Sampler

Computes an exact sample from the distribution of a given factor graph by forming a junction tree. Created: Nov 9, 2005

Version:
$Id: ExactSampler.java,v 1.1 2007/10/22 21:37:49 mccallum Exp $
Author:
Constructor Summary
ExactSampler()
           
ExactSampler(Randoms r)
           
 
Method Summary
 Assignment sample(FactorGraph mdl, int N)
          Samples from the distribution of a given undirected model.
 void setRandom(Randoms r)
          Sets the random seed used by this sampler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExactSampler

public ExactSampler()

ExactSampler

public ExactSampler(Randoms r)
Method Detail

sample

public Assignment sample(FactorGraph mdl,
                         int N)
Description copied from interface: Sampler
Samples from the distribution of a given undirected model.

Specified by:
sample in interface Sampler
Parameters:
mdl - Model to sample from
N - Number of samples to generate
Returns:
A list of assignments to the model.

setRandom

public void setRandom(Randoms r)
Description copied from interface: Sampler
Sets the random seed used by this sampler.

Specified by:
setRandom in interface Sampler
Parameters:
r - Random object to be used by this sampler.