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

New file structure for neural networks #1237

Merged
merged 6 commits into from
Aug 27, 2024
Merged

New file structure for neural networks #1237

merged 6 commits into from
Aug 27, 2024

Conversation

michaeldeistler
Copy link
Contributor

@michaeldeistler michaeldeistler commented Aug 27, 2024

File structure

Screenshot 2024-08-27 at 15 16 51

Imports

The following imports work:

from sbi.neural_nets import posterior_nn

from sbi.neural_nets.net_builders import build_maf
from sbi.neural_nets.embedding_nets import FCEmbedding
from sbi.neural_nets.estimators import MixedDensityEstimator

The following imports do not work:

from sbi.neural_nets import build_maf
from sbi.neural_nets import FCEmbedding
from sbi.neural_nets import MixedDensityEstimator

@michaeldeistler michaeldeistler force-pushed the neuralnets branch 3 times, most recently from df2dae7 to 657711a Compare August 27, 2024 13:10
@michaeldeistler michaeldeistler requested a review from janfb August 27, 2024 13:11
Copy link
Contributor

@janfb janfb left a comment

Choose a reason for hiding this comment

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

Great! I left some comments regarding error handling and naming.

sbi/neural_nets/__init__.py Outdated Show resolved Hide resolved
sbi/neural_nets/build_nets/__init__.py Outdated Show resolved Hide resolved
tests/density_estimator_test.py Outdated Show resolved Hide resolved
tests/density_estimator_test.py Outdated Show resolved Hide resolved
Copy link
Contributor

@janfb janfb left a comment

Choose a reason for hiding this comment

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

Great! Thanks a lot!

sbi/neural_nets/__init__.py Show resolved Hide resolved
Copy link

codecov bot commented Aug 27, 2024

Codecov Report

Attention: Patch coverage is 93.23308% with 9 lines in your changes missing coverage. Please review.

Project coverage is 78.18%. Comparing base (04c7b04) to head (7c2e945).
Report is 1 commits behind head on main.

Files Patch % Lines
sbi/neural_nets/__init__.py 57.14% 6 Missing ⚠️
sbi/neural_nets/embedding_nets/fully_connected.py 84.61% 2 Missing ⚠️
...eural_nets/embedding_nets/permutation_invariant.py 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1237      +/-   ##
==========================================
- Coverage   86.11%   78.18%   -7.93%     
==========================================
  Files         110      114       +4     
  Lines        8635     8669      +34     
==========================================
- Hits         7436     6778     -658     
- Misses       1199     1891     +692     
Flag Coverage Δ
unittests 78.18% <93.23%> (-7.93%) ⬇️

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

Files Coverage Δ
sbi/inference/fmpe/fmpe_base.py 94.33% <100.00%> (+0.05%) ⬆️
...inference/potentials/likelihood_based_potential.py 100.00% <100.00%> (ø)
sbi/inference/snle/mnle.py 85.36% <100.00%> (-7.32%) ⬇️
sbi/inference/snle/snle_base.py 93.93% <100.00%> (+0.06%) ⬆️
sbi/inference/snpe/snpe_base.py 91.66% <100.00%> (+0.04%) ⬆️
sbi/neural_nets/embedding_nets/__init__.py 100.00% <100.00%> (ø)
sbi/neural_nets/embedding_nets/cnn.py 100.00% <100.00%> (ø)
sbi/neural_nets/estimators/__init__.py 100.00% <100.00%> (ø)
sbi/neural_nets/estimators/score_estimator.py 92.89% <100.00%> (+0.39%) ⬆️
sbi/neural_nets/estimators/shape_handling.py 91.66% <ø> (ø)
... and 12 more

... and 26 files with indirect coverage changes

@michaeldeistler michaeldeistler merged commit 3b9be6a into main Aug 27, 2024
6 checks passed
@michaeldeistler michaeldeistler deleted the neuralnets branch August 27, 2024 15:11
@janfb janfb mentioned this pull request Aug 27, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants