Build a sampler for your model
Contents
Build a sampler for your model¶
-
aemcmc.basic.construct_sampler(obs_rvs_to_values, srng)[source]¶ Eagerly construct a sampler for a given set of observed variables and their observations.
- Parameters:
obs_rvs_to_values – A
dictof variables that maps stochastic elements (e.g.RandomVariables) to symbolicVariables representing their observed values.- Returns:
A
dictthat maps each random variable to its sampler step andany updates generated by the sampler steps.
The Sampler object¶
construct_sampler returns a Sampler object that contains the graphs for the variables’ sampling steps and the updates to pass to aesara.function:
-
class
aemcmc.types.Sampler(sample_steps, updates=<factory>, parameters=<factory>)[source]¶ A class that tracks sampling steps and their parameters.
-
parameters: Dict[aemcmc.types.SamplingStep, Tuple[aesara.tensor.var.TensorVariable]]¶ Parameters needed by the sampling steps.
-
sample_steps: Dict[aesara.tensor.var.TensorVariable, aesara.tensor.var.TensorVariable]¶ A map between measures and their updated value under the current sampling scheme.
-
stages: Dict[aemcmc.types.SamplingStep, List[aesara.tensor.var.TensorVariable]]¶ A list of the sampling stages sorted in scan order.
-
updates: Optional[Dict[aesara.graph.basic.Variable, aesara.tensor.var.TensorVariable]]¶ Updates to be passed to
aesara.function
-