Skip to content
Snippets Groups Projects

(Not so) Minor sampler refactoring of the samplers

Merged Moritz Huebner requested to merge minor_sampler_refactoring into master

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 and external_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 and calculate_autocorrelation have been moved to MCSampler, 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 the sampler 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 and sampler_init_kwargs properties, that properly separate those.
Edited by Moritz Huebner

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Moritz Huebner resolved all discussions

    resolved all discussions

  • Moritz Huebner added 10 commits

    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

    Compare with previous version

  • Moritz Huebner added 1 commit

    added 1 commit

    Compare with previous version

  • Moritz Huebner added 2 commits

    added 2 commits

    Compare with previous version

  • Moritz Huebner resolved all discussions

    resolved all discussions

  • Moritz Huebner added 6 commits

    added 6 commits

    Compare with previous version

  • mentioned in issue #185 (closed)

  • Moritz Huebner added 1 commit

    added 1 commit

    • a009c346 - renamed _run_external_sampler -> run_sampler

    Compare with previous version

  • Moritz Huebner added 7 commits

    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

    Compare with previous version

  • Moritz Huebner added 1 commit

    added 1 commit

    Compare with previous version

  • Moritz Huebner added 1 commit

    added 1 commit

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading