Closed
Description
Tell us about it
The trace.report
in PyMC3 now has attributes n_tune
, n_draws
and t_sampling
(see pymc-devs/pymc#3827).
I have this snippet to store those metadata with the trace:
idat = arviz.from_pymc3(trace)
if hasattr(trace.report, 'n_tune'):
idat.posterior.attrs['n_tune'] = trace.report.n_tune
idat.posterior.attrs['n_draws'] = trace.report.n_draws
idat.posterior.attrs['t_sampling'] = trace.report.t_sampling
Using n_draws
, one can now slice a trace that contains warmup iterations:
trace_warmup = trace[:-trace.report.n_draws] # <-- may result in len(trace_warmup) == 0
trace_posterior = trace[-trace.report.n_draws:]
Thoughts on implementation
I suppose both snippets should find their place in the PyMC3Converter, but I'm not sure how saving the warmup should be done.
Metadata
Metadata
Assignees
Labels
No labels