beanmachine.ppl.inference.proposer.nmc.single_site_half_space_nmc_proposer module

class beanmachine.ppl.inference.proposer.nmc.single_site_half_space_nmc_proposer.SingleSiteHalfSpaceNMCProposer(node: beanmachine.ppl.model.rv_identifier.RVIdentifier)

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

Single-Site Half Space Newtonian Monte Carlo Proposers. See sec. 3.2 of [1]

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

compute_alpha_beta(world: beanmachine.ppl.world.world.World) Tuple[bool, torch.Tensor, torch.Tensor]
Computes alpha and beta of the Gamma proposal given the node.

alpha = 1 - hessian_diag * x^2 beta = -1 * x * hessian_diag - first_grad

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.