tfp.experimental.mcmc.resample_deterministic_minimum_error
Stay organized with collections
Save and categorize content based on your preferences.
Deterministic minimum error resampler for sequential Monte Carlo.
tfp.experimental.mcmc.resample_deterministic_minimum_error(
log_probs,
event_size,
sample_shape,
seed=None,
name='resample_deterministic_minimum_error'
)
The return value of this function is similar to sampling with
expanded_sample_shape = tf.concat([sample_shape, [event_size]]), axis=-1)
tfd.Categorical(logits=log_probs).sample(expanded_sample_shape)`
but with values chosen deterministically so that the empirical distribution
is as close as possible to the specified distribution.
(Note that the empirical distribution can only exactly equal the requested
distribution if multiplying every probability by event_size
gives
an integer. So in general this is a biased "sampler".)
It is intended to provide a good representative sample, suitable for use
with some Sequential Monte Carlo algorithms.
This function is based on Algorithm #3 in [Maskell et al. (2006)][1].
Args |
log_probs
|
a tensor-valued batch of discrete log probability distributions.
|
event_size
|
the dimension of the vector considered a single draw.
|
sample_shape
|
the sample_shape determining the number of draws. Because
this resampler is deterministic it simply replicates the draw you
would get for sample_shape=[1] .
|
seed
|
This argument is unused but is present so that this function shares
its interface with the other resampling functions.
Default value: None
|
name
|
Python str name for ops created by this method.
Default value: None (i.e., 'resample_deterministic_minimum_error' ).
|
Returns |
resampled_indices
|
a tensor of samples.
|
References
[1]: S. Maskell, B. Alun-Jones and M. Macleod. A Single Instruction Multiple
Data Particle Filter.
In 2006 IEEE Nonlinear Statistical Signal Processing Workshop.
http://people.ds.cam.ac.uk/fanf2/hermes/doc/antiforgery/stats.pdf
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."],[],[]]