diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 0a72866314..fb1c5b4bb4 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -17,6 +17,7 @@ - `pm.Data` container can now be used for index variables, i.e with integer data and not only floats (issue [#3813](https://github.com/pymc-devs/pymc3/issues/3813), fixed by [#3925](https://github.com/pymc-devs/pymc3/pull/3925)). - `pm.Data` container can now be used as input for other random variables (issue [#3842](https://github.com/pymc-devs/pymc3/issues/3842), fixed by [#3925](https://github.com/pymc-devs/pymc3/pull/3925)). - Plots and Stats API sections now link to ArviZ documentation [#3927](https://github.com/pymc-devs/pymc3/pull/3927) +- Add `SamplerReport` with properties `n_draws`, `t_sampling` and `n_tune` to SMC. `n_tune` is always 0 [#3931](https://github.com/pymc-devs/pymc3/issues/3931). ### Maintenance - Tuning results no longer leak into sequentially sampled `Metropolis` chains (see #3733 and #3796). diff --git a/pymc3/smc/sample_smc.py b/pymc3/smc/sample_smc.py index 28bfa035ae..8538b25ca4 100644 --- a/pymc3/smc/sample_smc.py +++ b/pymc3/smc/sample_smc.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from .smc import SMC +import time import logging +from .smc import SMC def sample_smc( @@ -144,6 +145,7 @@ def sample_smc( random_seed=random_seed, ) + t1 = time.time() _log = logging.getLogger("pymc3") _log.info("Sample initial stage: ...") stage = 0 @@ -170,5 +172,7 @@ def sample_smc( smc.pool.join() trace = smc.posterior_to_trace() - + trace.report._n_draws = smc.draws + trace.report._n_tune = 0 + trace.report._t_sampling = time.time() - t1 return trace