beanmachine.ppl.world.initialize_fn module

beanmachine.ppl.world.initialize_fn.init_from_prior(distribution: torch.distributions.distribution.Distribution) torch.Tensor

Samples from the distribution.

Used as an arg for World

Parameters

distributiontorch.distribution.Distribution corresponding to the distribution to sample from

beanmachine.ppl.world.initialize_fn.init_to_uniform(distribution: torch.distributions.distribution.Distribution) torch.Tensor

Initializes a uniform distribution to sample from transformed to the support of distribution. A Categorical is used for discrete distributions, a bijective transform is used for constrained continuous distributions, and distribution is used otherwise.

Used as an arg for World

Parameters

distributiontorch.distribution.Distribution of the RV, usually the prior distribution.