mcd.sampler.UnadjustedLangevin#

class mcd.sampler.UnadjustedLangevin(pi_0, get_log_gamma, get_score_gamma_t, n_timesteps, T=1.0)[source]#

Bases: object

MCD and AIS for the time-inhomogeneous unadjusted Langevin algorithm.

T: float = 1.0[source]#

Duration of diffusion process.

delta: Array[source]#

Timestep size.

get_B_km1_ais(t, x_k)[source]#

Gets the AIS backward proposal.

Return type

Distribution

get_B_km1_mcd(t, x_k, model)[source]#

Gets the MCD backward kernel.

Return type

Distribution

get_F_k(t, x_km1)[source]#

Gets the forward Langevin kernel.

Return type

Distribution

get_log_gamma: Callable[[Array], Array][source]#

Gets the target log probability (potentially unnormalized).

get_loss(model, key)[source]#

Computes the loss for a single sample from the diffusion process.

Return type

Array

get_sample_ais(key)[source]#

Generates a sample and its log importance weight using AIS.

Return type

Tuple[Array, Array]

get_sample_mcd(model, key)[source]#

Generates a sample and its log importance weight using MCD.

Return type

Tuple[Array, Array]

get_score_gamma_t: Callable[[Array, Array], Array][source]#

` abla log pi(t, x)`.

Type

Gets

Type

math

get_trajectory_ais(key)[source]#

Generates a trajectory and its log importance weight with AIS.

Return type

Tuple[Array, Array]

get_trajectory_mcd(model, key)[source]#

Generates a trajectory and its log importance weight with MCD.

Return type

Tuple[Array, Array]

n_timesteps: int[source]#
pi_0: Distribution[source]#

Prior distribution for \(x\) at time \(t=0\).

shape: Tuple[int, ...][source]#

Data shape.