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 check that preds value need to be smaller than num_classes #357

Merged
merged 7 commits into from
Jul 9, 2021

Conversation

SkafteNicki
Copy link
Member

@SkafteNicki SkafteNicki commented Jul 7, 2021

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

Fixes #354
Remove that check that preds needs to be smaller than num_classes which does not make sense since we added support for logits. Updated tests case by scaling the logit test case with a factor 10 (to make sure generated values are bigger than num_classes=5).

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@SkafteNicki SkafteNicki added the bug / fix Something isn't working label Jul 7, 2021
@pep8speaks
Copy link

pep8speaks commented Jul 7, 2021

Hello @SkafteNicki! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-07-09 12:30:37 UTC

@codecov
Copy link

codecov bot commented Jul 7, 2021

Codecov Report

Merging #357 (574fc75) into master (0424c17) will decrease coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #357      +/-   ##
==========================================
- Coverage   96.44%   96.38%   -0.06%     
==========================================
  Files         112      112              
  Lines        3657     3655       -2     
==========================================
- Hits         3527     3523       -4     
- Misses        130      132       +2     
Flag Coverage Δ
Linux 76.38% <ø> (+0.01%) ⬆️
Windows 76.38% <ø> (+0.01%) ⬆️
cpu 96.38% <ø> (-0.01%) ⬇️
gpu ?
macOS 96.38% <ø> (-0.01%) ⬇️
pytest 96.38% <ø> (-0.06%) ⬇️
python3.6 95.54% <ø> (-0.01%) ⬇️
python3.8 96.38% <ø> (+0.76%) ⬆️
python3.9 96.27% <ø> (-0.01%) ⬇️
torch1.3.1 95.54% <ø> (-0.01%) ⬇️
torch1.4.0 95.62% <ø> (-0.01%) ⬇️
torch1.9.0 96.27% <ø> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
torchmetrics/utilities/checks.py 92.00% <ø> (-0.10%) ⬇️
torchmetrics/functional/regression/spearman.py 93.33% <0.00%> (-4.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0424c17...574fc75. Read the comment docs.

@SkafteNicki SkafteNicki linked an issue Jul 8, 2021 that may be closed by this pull request
Copy link
Member

@ethanwharris ethanwharris left a comment

Choose a reason for hiding this comment

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

LGTM 😃

@Borda Borda enabled auto-merge (squash) July 9, 2021 11:37
Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

LGTM !

@Borda Borda merged commit 3de06f9 into master Jul 9, 2021
@Borda Borda deleted the remove_check_for_logits branch July 9, 2021 15:18
@Borda Borda added this to the v0.5 milestone Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug / fix Something isn't working ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

logits cause error if they exceed num_classes ValueError Multiclass F1 with Logits
5 participants