-
Notifications
You must be signed in to change notification settings - Fork 32
🐛 Support binary scaling #174
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for binary scaling by adding a new parameter (eps) for numerical stability and updates related error messages and function signatures across multiple calibration scaler implementations.
- Introduces the eps parameter (default 1e-8) to vector, temperature, and matrix scalers.
- Updates constructor calls, documentation, and error messages to reflect the addition of eps.
- Adds abstract method decorators in the base scaler class to standardize API behavior.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
torch_uncertainty/post_processing/calibration/vector_scaler.py | Adds eps parameter to the constructor and passes it to the parent class. |
torch_uncertainty/post_processing/calibration/temperature_scaler.py | Adds eps parameter and updates the super call in the constructor. |
torch_uncertainty/post_processing/calibration/scaler.py | Adds eps parameter validation, updates labels conversion, and improves error messages. |
torch_uncertainty/post_processing/calibration/matrix_scaler.py | Adds eps parameter and passes it to the parent class; minor type annotation anomaly. |
Comments suppressed due to low confidence (1)
torch_uncertainty/post_processing/calibration/matrix_scaler.py:19
- The type annotation for the 'device' parameter appears ambiguous due to the bare identifier 'device'. Consider using 'torch.device' to maintain consistency with the other scaler files.
device: Literal["cpu", "cuda"] | device | None = None,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @o-laurent !
Closes #165.
I had some difficulties so we may squash and merge @alafage.