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

Loss progress tests #176

Conversation

Chase-Grajeda
Copy link
Collaborator

@Chase-Grajeda Chase-Grajeda commented Jun 26, 2024

Implements changes for Jira BF-28:
Added tests to inspect loss progress and loss on the progress bar

Changes:
test_approximators/test_fit.py

  • Added test_loss_progress to monitor the training loss progression in stdout. This is done by checking that the loss reported for each batch is not NaN, and ensuring that the captured epoch summary loss and validation loss match the model's history

test_approximators/conftest.py

  • Updated inference_network fixture to use CouplingFlow
  • Added inference variables and conditions to approximator fixture
  • Removed dataset fixture
  • Added simulator fixture to use new NormalSimulator
  • Added train_dataset fixture
  • Added validation_dataset fixture

simulators/normal_simulator.py

  • Added NormalSimulator with sampling for fit tests

simulators/__init__.py

  • Added import for NormalSimulator

Added test_loss_progress test to test_approximators/test_fit.py.
Updated fixtures in test_approximators/conftest.py to use OfflineDataset and CouplingFlow.
Refactored test to also test for validation loss in test_approximators/test_fit.py.
Added Normal Distribution Simulator class.
Refactored test_approximators/conftest.py to use OfflineDataset and NormalSimulator.
Added NormalSimulator import to simulators/__init__.py.
@Chase-Grajeda Chase-Grajeda self-assigned this Jun 26, 2024
@Chase-Grajeda Chase-Grajeda added the unit tests A new set of tests needs to be added. label Jun 26, 2024
Added fix for test failure on Keras Ubuntu output
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.82%. Comparing base (49bbe79) to head (2da5ec7).
Report is 10 commits behind head on streamlined-backend.

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

Additional details and impacted files
@@                   Coverage Diff                   @@
##           streamlined-backend     #176      +/-   ##
=======================================================
- Coverage                67.62%   66.82%   -0.80%     
=======================================================
  Files                       88       92       +4     
  Lines                     1640     1688      +48     
=======================================================
+ Hits                      1109     1128      +19     
- Misses                     531      560      +29     

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

@Chase-Grajeda Chase-Grajeda marked this pull request as ready for review June 26, 2024 21:42
@stefanradev93 stefanradev93 merged commit ff35ca6 into stefanradev93:streamlined-backend Jul 5, 2024
2 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unit tests A new set of tests needs to be added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants