tfp.experimental.mcmc.ThinningKernel
Stay organized with collections
Save and categorize content based on your preferences.
Discards samples to perform thinning.
Inherits From: TransitionKernel
tfp.experimental.mcmc.ThinningKernel(
inner_kernel, num_steps_to_skip, name=None
)
ThinningKernel
is a composable TransitionKernel
that thins samples
returned by its inner_kernel
. All Transition Kernels wrapping it will only
see non-discarded samples.
Args |
inner_kernel
|
TransitionKernel whose one_step will generate
MCMC results.
|
num_steps_to_skip
|
Integer or scalar Tensor representing
the number of chain steps skipped before collecting a result.
|
name
|
Python str name prefixed to Ops created by this function.
Default value: None (i.e., "thinning_kernel").
|
Attributes |
experimental_shard_axis_names
|
The shard axis names for members of the state.
|
inner_kernel
|
|
is_calibrated
|
Returns True if Markov chain converges to specified distribution.
TransitionKernel s which are "uncalibrated" are often calibrated by
composing them with the tfp.mcmc.MetropolisHastings TransitionKernel .
|
name
|
|
num_steps_to_skip
|
|
parameters
|
|
Methods
bootstrap_results
View source
bootstrap_results(
init_state
)
Instantiates a new kernel state with no calls.
Args |
init_state
|
Tensor or Python list of Tensor s representing the
state(s) of the Markov chain(s).
|
Returns |
kernel_results
|
collections.namedtuple of Tensor s representing
internal calculations made within this function.
|
copy
View source
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
View source
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
View source
one_step(
current_state, previous_kernel_results, seed=None
)
Collects one non-thinned chain state.
Args |
current_state
|
Tensor or Python list of Tensor s
representing the current state(s) of the Markov chain(s),
|
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 |
new_chain_state
|
Newest non-discarded MCMC chain state drawn from
the inner_kernel .
|
kernel_results
|
collections.namedtuple of internal calculations used to
advance the chain.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-11-21 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-21 UTC."],[],[]]