(Not so) Minor sampler refactoring of the samplers
This is the last of my series of MRs and builds on !199 (closed) and !200 (closed) and does a few things to simplify the samplers:
- I got rid of the redundant
external_sampler
andexternal_sampler_function
attribute - All samplers now have a static dictionary with default kwargs for the sampler
- These dicts contain all possible kwargs
- The previously obsolete
_verify_kwargs_against_external_sampler_function
now is called_verify_kwargs_against_default_kwargs
and checks against our dict of kwargs - The kwargs property/setter now has a common template. Child classes only have to implement
_translate_kwargs
, which handles incorrect kwargs. Most kwargs property/setters could therefore be removed - Introduced helper classes
MCSampler
and NestedSampler` - The methods to
setup_nburn
andcalculate_autocorrelation
have been moved toMCSampler
, since they don't really make sense outside of this right now - Some child classes implement an
__init__
method now and have some custom attributes - Dynesty now handles the nested sampler (
sampler
->self.sampler
) as an attribute internally. This removes thesampler
argument in some of the internal methods - Emcee now has some properties that refer to the respective kwargs
- In case that the external sampler constructs a sampler object and then calls a sampler method, there are now
sampler_function_kwargs
andsampler_init_kwargs
properties, that properly separate those.
Edited by Moritz Huebner
Merge request reports
Activity
added Refactoring label
- Resolved by Moritz Huebner
added 10 commits
- d9ba2c55 - A bug
- a32613e7 - Fixed ptemcee
- 74facfb8 - Added default_kwargs and rewrote some stuff to keep everything working
- a3de6280 - Removed redundant import
- 51655243 - Merge branch 'refactor_external_sampler_handling' into minor_sampler_refactoring
- 6acc7cba - changed nwalkers_equiv_kwargs
- 46e42150 - Merge branch 'introduce_translate_kwargs' into minor_sampler_refactoring
- cbfba5d1 - Made the number of walkers/livepoints etc consistent to be 500
- 12f98402 - Added tests for pymc3 kwargs
- 3ca00bce - Introduced NestedSampler/MCSampler helper classes
Toggle commit listadded 2 commits
added 6 commits
-
0ac5f10c...205dadd4 - 4 commits from branch
master
- 5de3b266 - Merge remote-tracking branch 'origin/master' into minor_sampler_refactoring
- 4107514a - Added some changelogs
-
0ac5f10c...205dadd4 - 4 commits from branch
mentioned in issue #185 (closed)
added 1 commit
- a009c346 - renamed _run_external_sampler -> run_sampler
added 7 commits
- 679dafca - Removed reference to external_sampler_function
- de4e5b7c - Fixed some stuff related to dynesty
- d3f01df0 - Calls NestedSampler init now
- 1d7c44b0 - Fixed some stuff related to emcee
- 2aa89376 - sorted attributes and kwargs properly
- 925f0037 - fixed something in _run_test
- 4bb2f7eb - Fixed a few smaller issues
Toggle commit list
Please register or sign in to reply