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

Remove Argmax Computation for torchmetrics in Classification and Segmentation #1777

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

nilsleh
Copy link
Collaborator

@nilsleh nilsleh commented Dec 15, 2023

Torchmetrics automatically applies the argmax on logits already if the datatype is float (so the logits) for the Classification Metrics https://lightning.ai/docs/torchmetrics/stable/classification/accuracy.html#multiclassaccuracy.

However, some metrics like Calibration Error expect the logits. So in order to overwrite the configuration of metrics without having to change the train, val , test steps, this PR removes the argmax computation.

@nilsleh nilsleh added this to the 0.5.2 milestone Dec 15, 2023
@github-actions github-actions bot added the trainers PyTorch Lightning trainers label Dec 15, 2023
@nilsleh nilsleh changed the title Remov Softmax Computation for torchmetrics in Classification and Segmentation Remov Argmax Computation for torchmetrics in Classification and Segmentation Dec 15, 2023
Copy link
Collaborator

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

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

You learn something new every day.

@adamjstewart adamjstewart merged commit ece7350 into microsoft:main Dec 15, 2023
21 checks passed
@adamjstewart adamjstewart changed the title Remov Argmax Computation for torchmetrics in Classification and Segmentation Remove Argmax Computation for torchmetrics in Classification and Segmentation Dec 20, 2023
isaaccorley pushed a commit that referenced this pull request Mar 2, 2024
…ntation (#1777)

* remove y_hat_hard

* argmax vs softmax :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
trainers PyTorch Lightning trainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants