Skip to content

✨ Docker settings, BatchEnsemble utilities rework + minor fixes #141

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

Merged
merged 73 commits into from
Mar 11, 2025
Merged

Conversation

alafage
Copy link
Contributor

@alafage alafage commented Mar 10, 2025

Also:

  • replace Wand by kornia
  • rework the dependency groups
  • fix experiment config files
  • various documentation improvements
  • GH workflow improvements
  • shortened long test due to the download of MNIST-C

Fixes #136
Fixes #138

tonyzamyatin and others added 30 commits March 4, 2025 09:50
Co-authored-by: Anton <anton.zamyatin@student.tuwien.ac.at>
🐛 Fix MNIST test dataloader for shifted data
Also fast-tracked another PR from @tonyzamyatin that got lost with the documentation due to a scheduling mistake.
alafage added 6 commits March 10, 2025 17:02
- now the input is repeated during training depending on `repeat_training_inputs` argument
- with `convert_layers==True` all `nn.Linear` and `nn.Conv2d` layers are replaced by `BatchLinear` and `BatchConv2d`
✨ LeNet BatchEnsemble and Deep Ensemble + minor bugfixes
@o-laurent o-laurent self-requested a review March 10, 2025 16:47
@o-laurent o-laurent added bug Something isn't working enhancement New feature or request dependencies Pull requests that update a dependency file labels Mar 10, 2025
@alafage alafage marked this pull request as ready for review March 10, 2025 16:53
Copy link

codecov bot commented Mar 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.19%. Comparing base (7d0d345) to head (1a07f0d).
Report is 74 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #141      +/-   ##
==========================================
+ Coverage   99.15%   99.19%   +0.03%     
==========================================
  Files         143      144       +1     
  Lines        7136     7192      +56     
  Branches      910      925      +15     
==========================================
+ Hits         7076     7134      +58     
+ Misses         27       26       -1     
+ Partials       33       32       -1     
Flag Coverage Δ
cpu 99.19% <100.00%> (+0.03%) ⬆️
pytest 99.19% <100.00%> (+0.03%) ⬆️

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

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

Copy link
Contributor

@o-laurent o-laurent left a comment

Choose a reason for hiding this comment

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

Just a few comments: we should be able to merge soon!

Thanks for your work!



class BatchEnsemble(nn.Module):
"""Wrap a BatchEnsemble model to ensure correct batch replication.
Copy link
Contributor

Choose a reason for hiding this comment

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

We decided to put all class docstrings below the __init__ for now, hence we should move it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alright, I just thought it would be cool to be able to view the docstring with your editor's "inline quick documentation" keyboard shortcut :)

Copy link
Contributor

@o-laurent o-laurent Mar 11, 2025

Choose a reason for hiding this comment

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

Ideally (unless mistaken), we should have docstrings split into two parts for all classes, but this would need a lot of time. If we don't do this, I tend to prefer having the arguments available when I instantiate a class so that I know what they mean instead of having them when hovering over the class itself. It would work like this, at least on VSCode; I don't know about PyCharm, which you seem to be using?

alafage and others added 2 commits March 11, 2025 00:42
Co-authored-by: o-laurent <olivier.laurent@ensta-paris.fr>
raise ValueError("`num_estimators` must be greater than 0.")


def batch_ensemble(
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to have this function and the class since they have exactly the same arguments?
The scope of this comment is actually larger because we have this kind of structure in many different files, even though we sometimes discourage using the classes by putting underscores.

@o-laurent o-laurent merged commit b3fe75e into main Mar 11, 2025
4 checks passed
@tonyzamyatin
Copy link
Contributor

🥳👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🔥 Remove the Wand dependency 🐛 Make sklearn properly optional
3 participants