blog
Class SamplingEngine

java.lang.Object
  extended by blog.InferenceEngine
      extended by blog.SamplingEngine

public class SamplingEngine
extends InferenceEngine

Inference engine that answers queries by sampling partial worlds (possibly with associated weights) from some sampling distribution, and collecting statistics over these samples.

The SamplingEngine constructor looks for the following properties in the properties table that is passed in:

samplerClass
Name of the Sampler subclass to use. Default is blog.LWSampler.
numSamples
Number of samples that answerQueries will run. Default is 10,000.
burnIn
Number of initial samples to treat as a burn-in period. Samples during this period will not be used to compute answers to queries. Default is 0.
reportInterval
Number of samples between progress reports. A progress report just involves printing how many samples have been done and how long the sampler has been running in this trial. Default is 500.
The property list is also passed to the sampler's constructor.


Field Summary
 
Fields inherited from class blog.InferenceEngine
evidence, model, queries
 
Constructor Summary
SamplingEngine(Model model, java.util.Properties properties)
          Creates a new sampling engine for the given BLOG model, with configuration parameters specified by the given properties table.
 
Method Summary
 void answerQueries()
          Computes the answers to the specified queries given the specified evidence.
 
Methods inherited from class blog.InferenceEngine
constructEngine, setEvidence, setQueries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SamplingEngine

public SamplingEngine(Model model,
                      java.util.Properties properties)
Creates a new sampling engine for the given BLOG model, with configuration parameters specified by the given properties table.

Method Detail

answerQueries

public void answerQueries()
Description copied from class: InferenceEngine
Computes the answers to the specified queries given the specified evidence. Records the answers by calling the appropriate methods (e.g., updateStats) on the specified Query objects.

Specified by:
answerQueries in class InferenceEngine