Runs one step of Uncalibrated Langevin discretized diffusion.
Inherits From: TransitionKernel
tfp.mcmc.UncalibratedLangevin(
target_log_prob_fn,
step_size,
volatility_fn=None,
parallel_iterations=10,
compute_acceptance=True,
experimental_shard_axis_names=None,
name=None
)
The class generates a Langevin proposal using _euler_method
function and
also computes helper UncalibratedLangevinKernelResults
for the next
iteration.
For more details on UncalibratedLangevin
, see
MetropolisAdjustedLangevinAlgorithm
.
Raises | |
---|---|
ValueError
|
if there isn't one step_size or a list with same length as
current_state .
|
TypeError
|
if volatility_fn is not callable.
|
Attributes | |
---|---|
compute_acceptance
|
|
experimental_shard_axis_names
|
The shard axis names for members of the state. |
is_calibrated
|
Returns True if Markov chain converges to specified distribution.
|
name
|
|
parallel_iterations
|
|
parameters
|
Return dict of __init__ arguments and their values.
|
step_size
|
|
target_log_prob_fn
|
|
volatility_fn
|
Methods
bootstrap_results
bootstrap_results(
init_state
)
Creates initial previous_kernel_results
using a supplied state
.
copy
copy(
**override_parameter_kwargs
)
Non-destructively creates a deep copy of the kernel.
Args | |
---|---|
**override_parameter_kwargs
|
Python String/value dictionary of
initialization arguments to override with new values.
|
Returns | |
---|---|
new_kernel
|
TransitionKernel object of same type as self ,
initialized with the union of self.parameters and
override_parameter_kwargs, with any shared keys overridden by the
value of override_parameter_kwargs, i.e.,
dict(self.parameters, **override_parameters_kwargs) .
|
experimental_with_shard_axes
experimental_with_shard_axes(
shard_axis_names
)
Returns a copy of the kernel with the provided shard axis names.
Args | |
---|---|
shard_axis_names
|
a structure of strings indicating the shard axis names for each component of this kernel's state. |
Returns | |
---|---|
A copy of the current kernel with the shard axis information. |
one_step
one_step(
current_state, previous_kernel_results, seed=None
)
Runs one iteration of MALA.
Args | |
---|---|
current_state
|
Tensor or Python list of Tensor s representing the
current state(s) of the Markov chain(s). The first r dimensions index
independent chains, r = tf.rank(target_log_prob_fn(*current_state)) .
|
previous_kernel_results
|
collections.namedtuple containing Tensor s
representing values from previous calls to this function (or from the
bootstrap_results function.)
|
seed
|
PRNG seed; see tfp.random.sanitize_seed for details.
|
Returns | |
---|---|
next_state
|
Tensor or Python list of Tensor s representing the state(s)
of the Markov chain(s) after taking exactly one step. Has same type and
shape as current_state .
|
kernel_results
|
collections.namedtuple of internal calculations used to
advance the chain.
|
Raises | |
---|---|
ValueError
|
if there isn't one step_size or a list with same length as
current_state or diffusion_drift .
|