lightning-flash icon indicating copy to clipboard operation
lightning-flash copied to clipboard

Add support for soft targets

Open ethanwharris opened this issue 2 years ago • 3 comments

What does this PR do?

Fixes # (issue)

Before submitting

  • [x] Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • [x] Did you read the contributor guideline, Pull Request section?
  • [x] Did you make sure your PR does only one thing, instead of bundling different changes together?
  • [x] Did you make sure to update the documentation with your changes?
  • [x] Did you write any new necessary tests? [not needed for typos/docs]
  • [x] Did you verify new and existing tests pass locally with your changes?
  • [ ] If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

  • [x] Is this pull request ready for review? (if not, please submit in draft mode)

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 🙃

ethanwharris avatar Mar 01 '22 22:03 ethanwharris

Codecov Report

Merging #1210 (d615d4d) into master (1a83376) will decrease coverage by 7.68%. The diff coverage is 100.00%.

:exclamation: Current head d615d4d differs from pull request most recent head 0752192. Consider uploading reports for the commit 0752192 to get more accurate results

@@            Coverage Diff             @@
##           master    #1210      +/-   ##
==========================================
- Coverage   92.28%   84.59%   -7.69%     
==========================================
  Files         287      287              
  Lines       13050    13056       +6     
==========================================
- Hits        12043    11045     -998     
- Misses       1007     2011    +1004     
Flag Coverage Δ
pytest 12.14% <37.50%> (+0.01%) :arrow_up:
tpu 12.14% <37.50%> (+0.01%) :arrow_up:
unittests 85.09% <100.00%> (-7.74%) :arrow_down:

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

Impacted Files Coverage Δ
flash/core/data/utilities/classification.py 97.23% <100.00%> (-1.05%) :arrow_down:
...lash/image/embedding/vissl/transforms/utilities.py 15.15% <0.00%> (-84.85%) :arrow_down:
flash/image/embedding/heads/vissl_heads.py 35.29% <0.00%> (-64.71%) :arrow_down:
flash/image/embedding/losses/vissl_losses.py 37.50% <0.00%> (-62.50%) :arrow_down:
flash/image/embedding/vissl/adapter.py 31.63% <0.00%> (-62.25%) :arrow_down:
flash/image/detection/input.py 38.88% <0.00%> (-61.12%) :arrow_down:
...age/face_detection/backbones/fastface_backbones.py 42.10% <0.00%> (-57.90%) :arrow_down:
flash/image/face_detection/model.py 36.84% <0.00%> (-55.27%) :arrow_down:
flash/image/face_detection/input_transform.py 46.87% <0.00%> (-53.13%) :arrow_down:
flash/image/face_detection/output_transform.py 47.05% <0.00%> (-52.95%) :arrow_down:
... and 55 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Mar 01 '22 22:03 codecov[bot]

seems there is some complication with TorchMetrics:

/opt/conda/lib/python3.7/site-packages/torchmetrics/utilities/checks.py in _check_classification_inputs(preds, target, threshold, num_classes, multiclass, top_k)
    249 
    250     # Basic validation (that does not need case/type information)
--> 251     _basic_input_validation(preds, target, threshold, multiclass)
    252 
    253     # Check that shape/types fall into one of the cases

/opt/conda/lib/python3.7/site-packages/torchmetrics/utilities/checks.py in _basic_input_validation(preds, target, threshold, multiclass)
     31 
     32     if target.is_floating_point():
---> 33         raise ValueError("The `target` has to be an integer tensor.")
     34     if target.min() < 0:
     35         raise ValueError("The `target` has to be a non-negative tensor.")

ValueError: The `target` has to be an integer tensor.

Borda avatar Mar 09 '22 10:03 Borda

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 10 '22 08:07 stale[bot]