-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add features to support ArviZ integration, Rebased #607
Conversation
Thanks! @janfb I'm happy to review when ready. |
I tried to resolve a series of merge conflicts due to API changes in |
Codecov Report
@@ Coverage Diff @@
## main #607 +/- ##
==========================================
+ Coverage 73.85% 74.25% +0.40%
==========================================
Files 79 79
Lines 5970 6032 +62
==========================================
+ Hits 4409 4479 +70
+ Misses 1561 1553 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
043a6fe
to
8b7c241
Compare
@sethaxen I finally finished this PR and would be very happy to get your feedback. No problem if do not find the time, just let me know. |
Awesome! I'm heading on vacation tomorrow so will review sometime on or after the 22nd if you haven't merged yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had a quick look, let's discuss in a minute
Accept tuning kwarg to SliceSampler Add SliceSamplerSerial Shares same interface as SliceSamplerVectorized Add posterior_sampler property Reset sampler after rejection sampling Set default var_name Interpret num_samples as per chain Test SliceSamplerSerial Test tuning keyword Test tuning and thin keywords Test posterior_sampler correctly set adapt mcmc refactoring and arviz integration to new sampler interface. Co-authored-by: Seth Axen <seth.axen@gmail.com> Co-authored-by: janfb <j.f.boelts@gmail.com> refactor usage and parallelization of slice samplers.
add option to construct InferenceData during sampling. update test. isort. add arviz. fix get_arviz. refactor, add get_samples to np slice samplers. arviz tutorial.
5406a9d
to
094625c
Compare
@sethaxen I am merging this now to get it into the next release, but I am happy to discuss the changes / improve the |
- fix reset of posterior sampler for new x. - fix docstrings.
Successor of #546 that was rebased onto
main
to include the new sampling interface. See comments there for reference.Tasks:
arviz
dependenciesarviz
test with Pyro MCMCChanges:
posterior_sampler
attribute toMCMCPosterior
that saves, e.g., thePyro
samplerMCMCPosterior
get_samples
method just likePyro
samplers to get the samples for all chains.get_samples
we can constructarviz
InferenceData
objects from all the samplers used inMCMCPosterior
InferenceData
from samples for the Pyro samplers as well (and not usingaz.from_pyro(sampler)
) because only then we can make sure the samples are not in transformed space.sample
to directly return the arviz object: this is useful as we have all the mcmc parameters and separate chains present in thesample
method.fixes #542