Skip to content

feat: flow matching methods - #1049

Merged
janfb merged 140 commits into
mainfrom
implementing-fmpe
Aug 14, 2024
Merged

janfb merged 140 commits into
mainfrom
implementing-fmpe

Conversation

@turnmanh

@turnmanh turnmanh commented Mar 20, 2024 •

Copy link
Copy Markdown
Collaborator

What does this implement/fix? Explain your changes

Implements basic Flow Matchting Posterior Estimation as described by Dax et al.

Does this close any currently open issues?

Fixes #963

Any relevant code examples, logs, error output, etc?

...

Any other comments?

...

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.

  • I have read and understood the contribution
    guidelines
  • I agree with re-licensing my contribution from AGPLv3 to Apache-2.0.
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have reported how long the new tests run and potentially marked them
    with pytest.mark.slow.
  • New and existing unit tests pass locally with my changes
  • I performed linting and formatting as described in the contribution
    guidelines
  • I rebased on main (or there are no conflicts with main)

@turnmanh turnmanh added the estimators Neural density estimators and the neural_nets module label Mar 20, 2024
@turnmanh turnmanh added this to the Hackathon 2024 milestone Mar 20, 2024
@turnmanh

Copy link
Copy Markdown
Collaborator Author

fyi @rdgao

@janfb
janfb force-pushed the implementing-fmpe branch from 739ea00 to d913aa5 Compare August 13, 2024 13:42
@janfb
janfb requested a review from michaeldeistler August 13, 2024 14:06
@janfb janfb self-assigned this Aug 13, 2024
@janfb janfb added the enhancement Improvement planned or wanted by the maintainers label Aug 13, 2024

@michaeldeistler michaeldeistler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is really not much to be said here, this is really great work! A few comments and questions below, but by and large this is good to go!

Comment thread sbi/inference/fmpe/fmpe_base.py Resolved
Comment thread sbi/inference/fmpe/fmpe_base.py Resolved
Comment thread sbi/neural_nets/embedding_nets.py Resolved
Comment thread sbi/neural_nets/embedding_nets.py Resolved
Comment thread sbi/neural_nets/flow_matcher.py Resolved
@codecov

codecov Bot commented Aug 13, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 94.71698% with 14 lines in your changes missing coverage. Please review.

Project coverage is 76.88%. Comparing base (366b67f) to head (31f8ad6).
Report is 1 commits behind head on main.

Files Patch % Lines
sbi/inference/fmpe/fmpe_base.py 94.33% 6 Missing ⚠️
..._nets/density_estimators/flowmatching_estimator.py 93.10% 4 Missing ⚠️
sbi/neural_nets/flow_matcher.py 97.59% 2 Missing ⚠️
sbi/inference/posteriors/ensemble_posterior.py 0.00% 1 Missing ⚠️
sbi/neural_nets/factory.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1049      +/-   ##
==========================================
- Coverage   84.86%   76.88%   -7.98%     
==========================================
  Files          97      101       +4     
  Lines        7677     7935     +258     
==========================================
- Hits         6515     6101     -414     
- Misses       1162     1834     +672     
Flag Coverage Δ
unittests 76.88% <94.71%> (-7.98%) ⬇️

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

Files Coverage Δ
sbi/inference/__init__.py 100.00% <100.00%> (ø)
sbi/inference/fmpe/__init__.py 100.00% <100.00%> (ø)
sbi/inference/snpe/snpe_base.py 91.61% <100.00%> (ø)
sbi/neural_nets/__init__.py 100.00% <100.00%> (ø)
sbi/neural_nets/density_estimators/__init__.py 100.00% <100.00%> (ø)
sbi/utils/sbiutils.py 78.35% <100.00%> (-8.26%) ⬇️
sbi/utils/user_input_checks.py 76.31% <ø> (ø)
sbi/inference/posteriors/ensemble_posterior.py 50.00% <0.00%> (-37.97%) ⬇️
sbi/neural_nets/factory.py 89.79% <88.88%> (-0.21%) ⬇️
sbi/neural_nets/flow_matcher.py 97.59% <97.59%> (ø)
... and 2 more

... and 22 files with indirect coverage changes

@janfb
janfb requested a review from michaeldeistler August 13, 2024 15:03
@janfb
janfb force-pushed the implementing-fmpe branch from d85c014 to 9e880d6 Compare August 14, 2024 06:55
@janfb
janfb merged commit 8f31c7b into main Aug 14, 2024
@janfb
janfb deleted the implementing-fmpe branch August 14, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement planned or wanted by the maintainers estimators Neural density estimators and the neural_nets module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Continuous normalizing flows via flow matching

7 participants