Skip to content
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 checkpointing callbacks #355

Merged
merged 9 commits into from
Nov 21, 2023
Merged

Add checkpointing callbacks #355

merged 9 commits into from
Nov 21, 2023

Conversation

mj-will
Copy link
Owner

@mj-will mj-will commented Nov 14, 2023

This PR adds support for a checkpoint callback: a function that is called instead of the default checkpoint function when the sampler tries to checkpoint.

This is motivated by the discussion in gwastro/pycbc#4567

Usage

def callback(state):
    # Save the state
    ...

fs = FlowSampler(
    model,
    ...,
    checkpoint_callback=callback,
)
fs.run()

To-Do

  • Documentation

@mj-will mj-will added enhancement New feature or request pycbc inference Changes related to pycbc inference compatibility labels Nov 14, 2023
@mj-will mj-will added this to the v0.11.0 milestone Nov 14, 2023
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5d93ca2) 93.26% compared to head (c96ecb9) 93.26%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #355   +/-   ##
=======================================
  Coverage   93.26%   93.26%           
=======================================
  Files          67       67           
  Lines        6296     6300    +4     
=======================================
+ Hits         5872     5876    +4     
  Misses        424      424           
Flag Coverage Δ
unittests 93.26% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mj-will mj-will merged commit d5cd2b7 into main Nov 21, 2023
@mj-will mj-will deleted the add-checkpointing-callbacks branch November 21, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pycbc inference Changes related to pycbc inference compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant