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

CIF Implementation #182

Conversation

Chase-Grajeda
Copy link

@Chase-Grajeda Chase-Grajeda commented Jul 22, 2024

Jira BF-57
Builds the architecture described in Continuously Indexed Normalising Flows [1]

Implemented changes:

  • Added the CIF class in cif.py. This is an InferenceNetwork that utilizes ELBO as a loss function, calculated from operations performed over a bijection and two conditional distributions p and q
  • Added the helper class ConditionalGaussian in conditional_gaussian.py. This is a conditional gaussian distribution where the means and standard deviations are calculated via a forward pass through two respective MLP networks.
  • Added examples/moons_cif.ipynb to demonstrate CIF usage with the Two Moons benchmark
  • Added CIF import to networks/__init__.py
  • Added CIF import to networks/cif/__init__.py

Notebook wip
@Chase-Grajeda Chase-Grajeda added feature New feature or request draft Draft Pull Request, Work in Progress labels Jul 22, 2024
@Chase-Grajeda Chase-Grajeda self-assigned this Jul 22, 2024
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@Chase-Grajeda Chase-Grajeda changed the title Create cif.ipynb CIF Implementation Jul 22, 2024
Added CIF class
Reworked notebook to be a demo for CIF usage
Fixed bug where incorrect batch shape was used to sample
Finished model in cif.py.
Added conditional_gaussian.py for ConditionalGaussian helper class.
Removed cif.ipynb example.
Added moons_cif.ipynb example.
Cleaning from pre-commit hook
@Chase-Grajeda Chase-Grajeda marked this pull request as ready for review August 6, 2024 19:01
@Chase-Grajeda Chase-Grajeda removed the draft Draft Pull Request, Work in Progress label Aug 6, 2024
@LarsKue
Copy link
Contributor

LarsKue commented Aug 16, 2024

Hi @Chase-Grajeda, can you please fetch the newest changes into this PR and ensure that the tests run? Thanks.

@LarsKue LarsKue requested review from LarsKue and removed request for stefanradev93 August 16, 2024 13:58
@stefanradev93
Copy link
Contributor

@Chase-Grajeda Can you fetch the newest changes into this PR and ensure that everything runs?

@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 31.03448% with 60 lines in your changes missing coverage. Please review.

Project coverage is 55.67%. Comparing base (230d094) to head (df94651).

Files with missing lines Patch % Lines
bayesflow/networks/cif/cif.py 27.08% 35 Missing ⚠️
bayesflow/networks/cif/conditional_gaussian.py 32.43% 25 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                   Coverage Diff                   @@
##           streamlined-backend     #182      +/-   ##
=======================================================
- Coverage                56.46%   55.67%   -0.80%     
=======================================================
  Files                      122      125       +3     
  Lines                     2708     2795      +87     
=======================================================
+ Hits                      1529     1556      +27     
- Misses                    1179     1239      +60     

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

@Chase-Grajeda
Copy link
Author

Fetched changes, tests are now passing

@stefanradev93 stefanradev93 merged commit 80ed60a into bayesflow-org:streamlined-backend Aug 31, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants