MONAI icon indicating copy to clipboard operation
MONAI copied to clipboard

fixes DiceCELoss for multichannel targets

Open myron opened this issue 2 years ago • 1 comments

Fixes DiceCELoss for multichannel targets. Currently if "target" (ground truth label) is provided as a multichannel data (each channel is binary or float), then current DiceCELoss attempts to convert it to 1-channel using argmax (which could be impossible with overlapping labels). There is no need for argmax, since pytorch's cross entropy can handle multi-channel targets already.

A few sentences describing the changes proposed in this pull request.

Types of changes

  • [x] Non-breaking change (fix or new feature that would not break existing functionality).
  • [ ] Breaking change (fix or new feature that would cause existing functionality to change).
  • [ ] New tests added to cover the changes.
  • [ ] Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • [ ] Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • [ ] In-line docstrings updated.
  • [ ] Documentation updated, tested make html command in the docs/ folder.

myron avatar Oct 08 '22 00:10 myron

added check for pytorch version

myron avatar Oct 09 '22 22:10 myron

/black

wyli avatar Oct 12 '22 17:10 wyli

/build

wyli avatar Oct 12 '22 17:10 wyli

some checks are failing, but it's something unrelated

myron avatar Oct 12 '22 18:10 myron

/build

wyli avatar Oct 12 '22 18:10 wyli