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

Metric docs fix #2209

Merged
merged 34 commits into from
Jun 17, 2020
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2d5b8e9
fix docs
Jun 16, 2020
5400081
Update docs/source/metrics.rst
williamFalcon Jun 16, 2020
de5083f
Update docs/source/metrics.rst
williamFalcon Jun 16, 2020
a902b30
Update docs/source/metrics.rst
williamFalcon Jun 16, 2020
c2145fa
Update docs/source/metrics.rst
williamFalcon Jun 16, 2020
c8d3a91
Update metrics.rst
williamFalcon Jun 16, 2020
4556f6e
title
Borda Jun 16, 2020
254b023
fix
Jun 16, 2020
6b11067
fix for num_classes
Jun 16, 2020
4cadc58
chlog
Borda Jun 16, 2020
63690bf
nb classes
Borda Jun 16, 2020
0ecc521
hints
Borda Jun 16, 2020
9f1cbd1
zero division
Borda Jun 16, 2020
46f59d9
add tests
Borda Jun 16, 2020
1660e42
Update metrics.rst
edenlightning Jun 16, 2020
2a407a9
Update classification.py
edenlightning Jun 16, 2020
81095a7
Update classification.py
edenlightning Jun 16, 2020
764b52a
prune doctests
Borda Jun 16, 2020
d5e1b31
Merge branch 'metric_docs' of https://github.com/SkafteNicki/pytorch-…
Borda Jun 16, 2020
770787e
docs
Borda Jun 16, 2020
8cd4a52
Apply suggestions from code review
Borda Jun 16, 2020
4de28c3
Apply suggestions from code review
Borda Jun 16, 2020
70f9162
flake8
Borda Jun 16, 2020
f6144ee
doctests
Borda Jun 16, 2020
7f201ee
formatting
Borda Jun 16, 2020
7701bd4
cleaning
Borda Jun 16, 2020
fe6699a
formatting
Borda Jun 16, 2020
1810dfe
formatting
Borda Jun 16, 2020
59e49a4
doctests
Borda Jun 16, 2020
f3a0fb3
flake8
Borda Jun 16, 2020
caaacf9
docs
Borda Jun 16, 2020
af872fc
rename
Borda Jun 17, 2020
f9ee46b
rename
Borda Jun 17, 2020
ae0b3c6
typo
Borda Jun 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pytorch_lightning/metrics/functional/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def get_num_classes(
num_classes = pred.size(1)
else:
num_target_classes = int(target.max().detach().item() + 1)
num_classes = num_target_classes
num_pred_classes = int(pred.max().detach().item() + 1)
Borda marked this conversation as resolved.
Show resolved Hide resolved
Borda marked this conversation as resolved.
Show resolved Hide resolved
num_classes = max(num_target_classes, num_pred_classes)
return num_classes


Expand Down