diff options
author | Ian Langmore <langmore@google.com> | 2018-02-20 13:04:51 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-02-20 13:16:41 -0800 |
commit | 0632e92abc4f08ffacf6802205f9880accf7ecd2 (patch) | |
tree | bd97766d9e9e2286d745f6547c854c0081c09fea /tensorflow/contrib/bayesflow | |
parent | 6d1a1433707b37915207c11c2f0e91fcbc862bea (diff) |
DOCFIX: hmc.sample_chain kwarg num_steps_between_results docstring seemed to
indicate a different type of thinning than what is actually going on.
PiperOrigin-RevId: 186349630
Diffstat (limited to 'tensorflow/contrib/bayesflow')
-rw-r--r-- | tensorflow/contrib/bayesflow/python/ops/hmc_impl.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tensorflow/contrib/bayesflow/python/ops/hmc_impl.py b/tensorflow/contrib/bayesflow/python/ops/hmc_impl.py index f724910c59..9e45c19411 100644 --- a/tensorflow/contrib/bayesflow/python/ops/hmc_impl.py +++ b/tensorflow/contrib/bayesflow/python/ops/hmc_impl.py @@ -109,10 +109,13 @@ def sample_chain( Note: `target_log_prob_fn` is called exactly twice. - Only one out of every `num_steps_between_samples + 1` steps is included in the - returned results. This "thinning" comes at a cost of reduced statistical - power, while reducing memory requirements and autocorrelation. For more - discussion see [1]. + Since HMC states are correlated, it is sometimes desirable to produce + additional intermediate states, and then discard them, ending up with a set of + states with decreased autocorrelation. See [1]. Such "thinning" is made + possible by setting `num_steps_between_results > 0`. The chain then takes + `num_steps_between_results` extra steps between the steps that make it into + the results. The extra steps are never materialized (in calls to `sess.run`), + and thus do not increase memory requirements. [1]: "Statistically efficient thinning of a Markov chain sampler." Art B. Owen. April 2017. @@ -225,10 +228,8 @@ def sample_chain( Default value: 0 (i.e., no burn-in). num_steps_between_results: Integer number of chain steps between collecting a result. Only one out of every `num_steps_between_samples + 1` steps is - included in the returned results. This "thinning" comes at a cost of - reduced statistical power, while reducing memory requirements and - autocorrelation. For more discussion see [1]. - Default value: 0 (i.e., no subsampling). + included in the returned results. The number of returned chain states is + still equal to `num_results`. Default value: 0 (i.e., no thinning). seed: Python integer to seed the random number generator. current_target_log_prob: (Optional) `Tensor` representing the value of `target_log_prob_fn` at the `current_state`. The only reason to specify |