public class ForwardSampler extends java.lang.Object implements SamplingAlgorithm
| Constructor and Description |
|---|
ForwardSampler(BayesianNetwork network,
java.util.List<? extends Variable> variablesToSampleFrom,
java.util.List<Vertex> topologicallySortedVertices,
KeanuRandom random,
boolean calculateSampleProbability) |
| Modifier and Type | Method and Description |
|---|---|
NetworkSample |
sample()
Takes a sample with the algorithm and returns the state of the network for that sample.
|
void |
sample(java.util.Map<VariableReference,java.util.List<?>> samples,
java.util.List<java.lang.Double> logOfMasterPForEachSample)
Takes a sample with the algorithm and saves it in the supplied map (creating a new entry in the list if the
Variable already exists).
|
void |
step()
Move forward the state of the Sampling Algorithm by a single step but do not return anything.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittakeSamplepublic ForwardSampler(BayesianNetwork network, java.util.List<? extends Variable> variablesToSampleFrom, java.util.List<Vertex> topologicallySortedVertices, KeanuRandom random, boolean calculateSampleProbability)
public void step()
SamplingAlgorithmstep in interface SamplingAlgorithmpublic void sample(java.util.Map<VariableReference,java.util.List<?>> samples, java.util.List<java.lang.Double> logOfMasterPForEachSample)
SamplingAlgorithmsample in interface SamplingAlgorithmsamples - map to store sampled variable valueslogOfMasterPForEachSample - list of log of master probability for each samplepublic NetworkSample sample()
SamplingAlgorithmsample in interface SamplingAlgorithm