Closed dilpath closed 6 months ago
Attention: Patch coverage is 70.83333%
with 14 lines
in your changes are missing coverage. Please review.
Project coverage is 82.38%. Comparing base (
81ff7ff
) to head (29a5069
).
Files | Patch % | Lines |
---|---|---|
pypesto/sample/dynesty.py | 70.83% | 14 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks Dilan! I check your branch and something seems not quite right yet
sampler.results.logz
does not have the same size before and after loading it restore_internal_sampler
I get AttributeError: 'DynestySampler' object has no attribute 'results'
. However, using directly dynesty.utils.restore_sampler
works fine. (this issue was already there before your updates)
- some results seem to be discared:
sampler.results.logz
does not have the same size before and after loading it
Works fine for me, logz
is the same shape before and after using save_raw_results
and load_raw_results
. However, these methods do not save the dynesty DynestySampler.sampler
object. Could you try e.g.
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)
- Moreover, if I call
restore_internal_sampler
I getAttributeError: 'DynestySampler' object has no attribute 'results'
. However, using directlydynesty.utils.restore_sampler
works fine. (this issue was already there before your updates)
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)
AttributeError: 'DynestySampler' object has no attribute 'results'
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
pypesto_sampler.sampler
will have pypesto_sampler.sampler.results
.
to reproduce the attribute error use in the sampler notebook
sampler = sample.DynestySampler(objective_type="negloglike")
result = sample.sample(
problem=problem,
n_samples=None,
sampler=sampler,
filename=None,
)
print(sampler.results.logz)
sampler.save_internal_sampler("dynesty.dill")
dummy_sampler = sample.DynestySampler()
dummy_sampler.restore_internal_sampler("dynesty.dill")
print(dummy_sampler.results.logz)
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
.