A sample is a map from elements to their values.
A sample is a map from elements to their values.
Number of samples to throw away initially.
Number of samples to throw away initially.
The algorithm to compute probability of specified evidence in a dependent universe.
The algorithm to compute probability of specified evidence in a dependent universe. We use () => Double to represent this algorithm instead of an instance of ProbEvidenceAlgorithm. Typical usage is to return the result of ProbEvidenceAlgorithm.computeProbEvidence when invoked.
A list of universes that depend on this universe such that evidence on those universes should be taken into account in this universe.
A list of universes that depend on this universe such that evidence on those universes should be taken into account in this universe.
All implementations of factored algorithms must specify a way to get the factors from the given universe and dependent universes.
All implementations of factored algorithms must specify a way to get the factors from the given universe and dependent universes.
Iterations thrown away between samples.
Iterations thrown away between samples.
Produce a single sample.
Produce a single sample.
Semiring for use in factors.
Semiring for use in factors.
Elements whose samples will be recorded at each iteration.
Elements whose samples will be recorded at each iteration.
Called when the algorithm is killed.
Called when the algorithm is killed. By default, does nothing. Can be overridden.
Method to create a blocking scheme given information about the model and factors.
Method to create a blocking scheme given information about the model and factors.
The most recent set of samples, used for sampling variables conditioned on the values of other variables.
The most recent set of samples, used for sampling variables conditioned on the values of other variables.
List of all factors.
List of all factors.
Get the elements that are needed by the query target variables and the evidence variables.
Get the elements that are needed by the query target variables and the evidence variables. Also compute the values of those variables to the given depth. Only get factors for elements that are actually used by the target variables. This is more efficient. Also, it avoids problems when values of unused elements have not been computed.
In addition to getting all the needed elements, it determines if any of the conditioned, constrained, or dependent universe parent elements has * in its range. If any of these elements has * in its range, the lower and upper bounds of factors will be different, so we need to compute both. If they don't, we don't need to compute bounds.
Number of samples taken
Number of samples taken
Called when the algorithm is started before running any steps.
Called when the algorithm is started before running any steps. By default, does nothing. Can be overridden.
Kill the algorithm so that it is inactive.
Kill the algorithm so that it is inactive. It will no longer be able to provide answers.Throws AlgorithmInactiveException if the algorithm is not active.
Resume the computation of the algorithm, if it has been stopped.
Resume the computation of the algorithm, if it has been stopped. Throws AlgorithmInactiveException if the algorithm is not active.
Start the algorithm and make it active.
Start the algorithm and make it active. After it returns, the algorithm must be ready to provide answers. Throws AlgorithmActiveException if the algorithm is already active.
Stop the algorithm from computing.
Stop the algorithm from computing. The algorithm is still ready to provide answers after it returns. Throws AlgorithmInactiveException if the algorithm is not active.
Variables to sample at each time step.
Variables to sample at each time step.
The default trait for creating blocks. Works on Chain, Apply, Atomic, and Constant elements. Note that our choice of blocking scheme fails when the results of a Chain have disjoint ranges. We are forced to do this to prevent exponentially slow time performance on models with Chains. A more detailed explanation is available in the FactorProduct trait in BlockSampler.scala.