Unverified Commit 30d28f44 authored by Osvaldo Martin's avatar Osvaldo Martin Committed by GitHub

add n_draws and t_sampling report to smc (#3931)

* add n_draws and t_sampling report to smc

* add _n_tune

* update release notes

* resolve conflicts
parent 1522492b
...@@ -17,6 +17,7 @@ ...@@ -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 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)). - `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) - 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 ### Maintenance
- Tuning results no longer leak into sequentially sampled `Metropolis` chains (see #3733 and #3796). - Tuning results no longer leak into sequentially sampled `Metropolis` chains (see #3733 and #3796).
......
...@@ -12,8 +12,9 @@ ...@@ -12,8 +12,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .smc import SMC import time
import logging import logging
from .smc import SMC
def sample_smc( def sample_smc(
...@@ -144,6 +145,7 @@ def sample_smc( ...@@ -144,6 +145,7 @@ def sample_smc(
random_seed=random_seed, random_seed=random_seed,
) )
t1 = time.time()
_log = logging.getLogger("pymc3") _log = logging.getLogger("pymc3")
_log.info("Sample initial stage: ...") _log.info("Sample initial stage: ...")
stage = 0 stage = 0
...@@ -170,5 +172,7 @@ def sample_smc( ...@@ -170,5 +172,7 @@ def sample_smc(
smc.pool.join() smc.pool.join()
trace = smc.posterior_to_trace() 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 return trace
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment