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

Fix failing tutorials, change MNLE default for log_transform to False #1367

Merged
merged 3 commits into from
Jan 20, 2025

Conversation

janfb
Copy link
Contributor

@janfb janfb commented Jan 15, 2025

The change to detecting NaNs in all losses already payed off: In MNLE, we were using the log_transform=True per default. This was performing better and makes sense for positive data like reaction times in decision-making experiments. However, it does not make sense in general. In implemented methods tutorial we were passing Gaussian data, which then caused NaNs after the log-transform, causing the loss to become NaN.

This PR

  • changes the default to False and add small improvements to the tutorial notebook.
  • adapt all tutorial and example notebooks to explicitly apply the log transform when dealing with bounded decision-making data
  • fix bug in Decision-Making Example notebook that caused the time-our error in Continuous-Deployment (main tests failing)

@manuelgloeckler / @michaeldeistler can you have a look please?

@janfb janfb requested a review from manuelgloeckler January 15, 2025 15:51
@janfb janfb changed the title Fix failing tutorials Fix failing tutorials, change MNLE default for log_transform to False Jan 15, 2025
This was set to True for positive reaction times but does not hold in general.
@janfb janfb force-pushed the fix-failing-tutorials branch from 533fca9 to f67ee92 Compare January 16, 2025 16:25
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.23%. Comparing base (d3f22b5) to head (40a7dde).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1367      +/-   ##
==========================================
- Coverage   89.40%   89.23%   -0.18%     
==========================================
  Files         118      118              
  Lines        8715     8779      +64     
==========================================
+ Hits         7792     7834      +42     
- Misses        923      945      +22     
Flag Coverage Δ
unittests 89.23% <ø> (-0.18%) ⬇️

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

Files with missing lines Coverage Δ
sbi/neural_nets/net_builders/mnle.py 100.00% <ø> (ø)

... and 6 files with indirect coverage changes

@janfb janfb requested review from michaeldeistler and removed request for manuelgloeckler January 20, 2025 17:33
Copy link
Contributor

@michaeldeistler michaeldeistler left a comment

Choose a reason for hiding this comment

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

LGTM!

tutorials/16_implemented_methods.ipynb Show resolved Hide resolved
@janfb janfb merged commit 80740b2 into main Jan 20, 2025
7 checks passed
@janfb janfb deleted the fix-failing-tutorials branch January 20, 2025 17:43
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