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:, 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.


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


alpha of the Dirichlet distribution as proposal distribution

get_proposal_distribution(world: torch.distributions.distribution.Distribution

Returns the proposal distribution of the node.


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


The proposal distribution.