-
Notifications
You must be signed in to change notification settings - Fork 47
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
dynesty: new method to save only the raw dynesty sample results #1331
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #1331 +/- ##
===========================================
- Coverage 84.29% 82.38% -1.91%
===========================================
Files 152 152
Lines 12432 12452 +20
===========================================
- Hits 10479 10259 -220
- Misses 1953 2193 +240 ☔ View full report in Codecov by Sentry. |
Thanks Dilan! I check your branch and something seems not quite right yet
|
Works fine for me, print(pypesto_sampler.sampler.results.logz.shape)
pypesto.sample.dynesty.save_raw_results(pypesto_sampler, "dynesty.raw")
raw_results = pypesto.sample.dynesty.load_raw_results("dynesty.raw")
print(raw_results.logz.shape)
Also cannot reproduce, e.g. with print(pypesto_sampler_original.sampler.results.logz.shape)
pypesto_sampler_original.save_internal_sampler("dynesty.dill")
pypesto_sampler = pypesto.sample.DynestySampler(objective_type="negloglike")
pypesto_sampler.restore_internal_sampler("dynesty.dill")
print(pypesto_sampler.sampler.results.logz.shape)
Maybe you are trying to access the pyPESTO sampler object, instead of the dynesty sampler object? # pyPESTO sampler object is `DynestySampler`
pypesto_sampler = pypesto.sample.DynestySampler()
# dynesty sampler object is at `DynestySampler.sampler`
pypesto_sampler.sampler
|
to reproduce the attribute error use in the sampler notebook
|
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.
Now this is fixed, thanks!
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.
Looks good to me. Nice to circumvent the confusion if one does not need to deal with sampler.results
and sampler.sampler.results
anymore, but can access the raw results more easily now.
Thanks.
With this change, things like AMICI models that exist in the dynesty loglikelihood, are not saved in the dynesty internal result.
Dummy pyPESTO objects (e.g. for analysis or plotting) can be created by supplying the
raw_results
toget_original_dynesty_samples
orget_mcmc_like_dynesty_samples
.