tfp.experimental.mcmc.augment_with_state_history
Stay organized with collections
Save and categorize content based on your preferences.
Decorates a transition or proposal fn to track state history.
tfp.experimental.mcmc.augment_with_state_history(
fn
)
For example usage, see
tfp.experimental.mcmc.augment_prior_with_state_history
.
Args |
fn
|
Python callable to wrap, having signature
new_state_dist = fn(step, state_with_history, **kwargs) where
state_with_history is a StateWithHistory namedtuple.
|
Returns |
augmented_fn
|
Python callable wrapping fn , having signature
new_state_with_history_dist = augmented_fn(step, state_with_history,
**kwargs) . The return value is a tfd.JointDistributionNamed instance
overtfp.experimental.mcmc.StateWithHistory namedtuples, in which the
state_history component is rotated to discard
the (previously-oldest) state at the initial position and append the
new state at the final position.
|
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.
[null,null,["Last updated 2023-11-21 UTC."],[],[],null,["# tfp.experimental.mcmc.augment_with_state_history\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/experimental/mcmc/particle_filter_augmentation.py#L87-L128) |\n\nDecorates a transition or proposal fn to track state history. \n\n tfp.experimental.mcmc.augment_with_state_history(\n fn\n )\n\nFor example usage, see\n[`tfp.experimental.mcmc.augment_prior_with_state_history`](../../../tfp/experimental/mcmc/augment_prior_with_state_history).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `fn` | Python `callable` to wrap, having signature `new_state_dist = fn(step, state_with_history, **kwargs)` where `state_with_history` is a `StateWithHistory` namedtuple. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `augmented_fn` | Python `callable` wrapping `fn`, having signature `new_state_with_history_dist = augmented_fn(step, state_with_history, **kwargs)`. The return value is a `tfd.JointDistributionNamed` instance over[`tfp.experimental.mcmc.StateWithHistory`](../../../tfp/experimental/mcmc/StateWithHistory) namedtuples, in which the `state_history` component is rotated to discard the (previously-oldest) state at the initial position and append the new state at the final position. |\n\n\u003cbr /\u003e"]]