beanmachine.ppl.inference.proposer.nmc.single_site_simplex_space_nmc_proposer module

class beanmachine.ppl.inference.proposer.nmc.single_site_simplex_space_nmc_proposer.SingleSiteSimplexSpaceNMCProposer(node: beanmachine.ppl.model.rv_identifier.RVIdentifier, transform: torch.distributions.transforms.Transform = ComposeTransform())

Bases: beanmachine.ppl.inference.proposer.single_site_ancestral_proposer.SingleSiteAncestralProposer

Single-Site Simplex Newtonian Monte Carlo Proposer See sec. 3.2 of [1]

[1] Arora, Nim, et al. Newtonian Monte Carlo: single-site MCMC meets second-order gradient methods

compute_alpha(world: beanmachine.ppl.world.world.World, min_alpha_value: float = 0.001) Tuple[bool, torch.Tensor]
Computes alpha of the Dirichlet proposal given the node.
alpha = 1 - (x^2) (hessian[i, i] - max(hessian[i]))

where max(hessian[i]) is maximum of the hessian at ith row excluding the diagonal values.

Parameters

node_var – the node Variable we’re proposing a new value for

Returns

alpha of the Dirichlet distribution as proposal distribution

get_proposal_distribution(world: beanmachine.ppl.world.world.World) torch.distributions.distribution.Distribution

Returns the proposal distribution of the node.

Parameters

world – the world in which we’re proposing a new value for node.

Returns

The proposal distribution.