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
dict
of variables that maps stochastic elements (e.g.RandomVariable
s) to symbolicVariable
s representing their observed values.- Returns:
A
dict
that 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#
Parameters needed by the sampling steps.
- sample_steps#
A map between measures and their updated value under the current sampling scheme.
- stages#
A list of the sampling stages sorted in scan order.
- updates#
Updates to be passed to
aesara.function