Calls cleanUp() on all algorithms.
Calls cleanUp() on all algorithms.
Return an estimate of the expectation of the function under the marginal probability distribution of the target.
Return an estimate of the expectation of the function under the marginal probability distribution of the target.
Return an estimate of the expectation of the function under the marginal probability distribution of the target.
Return an estimate of the expectation of the function under the marginal probability distribution of the target.
Return an estimate of the probability of the predicate under the marginal probability distribution of the target.
Return an estimate of the probability of the predicate under the marginal probability distribution of the target.
Return an estimate of the marginal probability distribution over the target that lists each element with its probability.
Return an estimate of the marginal probability distribution over the target that lists each element with its probability. The result is a lazy stream. It is up to the algorithm how the stream is ordered. Throws NotATargetException if called on a target that is not in the list of targets of the algorithm. Throws AlgorithmInactiveException if the algorithm is inactive.
Methods from BaseProbQueryAlgorithm *
Methods from BaseProbQueryAlgorithm *
Get an element from a reference *
Get an element from a reference *
Return an estimate of the expectation of the function under the marginal probability distribution of the target.
Return an estimate of the expectation of the function under the marginal probability distribution of the target. Throws NotATargetException if called on a target that is not in the list of targets of the algorithm. Throws AlgorithmInactiveException if the algorithm is inactive.
Log sum of total weights of individual algorithms *
Log sum of total weights of individual algorithms *
Calls initialize() on all algorithms.
Calls initialize() on all algorithms.
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.
Return the mean of the probability density function for the given continuous element.
Return the mean of the probability density function for the given continuous element.
A parallel collection of algorithms *
A parallel collection of algorithms *
Return an estimate of the probability that the target produces the value.
Return an estimate of the probability that the target produces the value. Throws NotATargetException if called on a target that is not in the list of targets of the algorithm. Throws AlgorithmInactiveException if the algorithm is inactive.
Return an estimate of the probability of the predicate under the marginal probability distribution of the target.
Return an estimate of the probability of the predicate under the marginal probability distribution of the target. Throws NotATargetException if called on a target that is not in the list of targets of the algorithm. Throws AlgorithmInactiveException if the algorithm is inactive.
The query targets are references in this case *
The query targets are references in this case *
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.
Return the variance of the probability density function for the given continuous element.
Return the variance of the probability density function for the given continuous element.
Parallel version of a sampling algorithm. Has a parallel collection of algorithm instances that will do its work on separate threads, over separate universes. Uses Scala's parallel collections to divide up the work, so it will work best if told to run on a number of threads less than or equal to the number of worker threads Scala creates when operating over parallel collections.
This creates two major differences with how a user interacts with the algorithm. First of all, rather than defining a model on a universe and then starting the algorithm, the user must define a function that generates a universe and applies any evidence, and then pass that to the companion object to create the algorithm. The second major difference is that elements must be referred to using references, since each variable will exist as multiple elements across the different universes.
One-time sampling will be faster, since it divides the work over the different threads. Anytime sampling should provide more accurate results, since it can take more samples over the same amount of time. Both cases will most likely require more memory, at least using the current implementation of WeightedSampler, which keeps track of all values and weights that have been sampled. When querying, a weighted combination of the results of the various threads is returned. This last step adds some overhead, which should be negligible as long as you are taking a large number of samples.