Skip to content

fixes DiceCELoss for multichannel targets#5292

Merged
wyli merged 8 commits intoProject-MONAI:devfrom
myron:dicece
Oct 12, 2022
Merged

fixes DiceCELoss for multichannel targets#5292
wyli merged 8 commits intoProject-MONAI:devfrom
myron:dicece

Conversation

@myron
Copy link
Copy Markdown
Collaborator

@myron myron commented Oct 8, 2022

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

  • 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 myron added the bug Something isn't working label Oct 8, 2022
@myron myron added this to the Auto3D Seg framework [P0 v1.0] milestone Oct 8, 2022
@myron
Copy link
Copy Markdown
Collaborator Author

myron commented Oct 9, 2022

added check for pytorch version

Signed-off-by: myron <[email protected]>
@wyli
Copy link
Copy Markdown
Contributor

wyli commented Oct 12, 2022

/black

Signed-off-by: monai-bot <[email protected]>
@wyli
Copy link
Copy Markdown
Contributor

wyli commented Oct 12, 2022

/build

@wyli wyli enabled auto-merge (squash) October 12, 2022 17:35
@wyli wyli disabled auto-merge October 12, 2022 17:35
@wyli wyli enabled auto-merge (squash) October 12, 2022 17:35
@myron
Copy link
Copy Markdown
Collaborator Author

myron commented Oct 12, 2022

some checks are failing, but it's something unrelated

Signed-off-by: Wenqi Li <[email protected]>
@wyli
Copy link
Copy Markdown
Contributor

wyli commented Oct 12, 2022

/build

@wyli wyli merged commit 32a237a into Project-MONAI:dev Oct 12, 2022
wyli pushed a commit that referenced this pull request Oct 12, 2022
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.


### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [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.

Signed-off-by: myron <[email protected]>
Signed-off-by: monai-bot <[email protected]>
Co-authored-by: monai-bot <[email protected]>
@myron myron deleted the dicece branch October 22, 2022 18:50
KumoLiu pushed a commit that referenced this pull request Nov 2, 2022
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.


### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [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.

Signed-off-by: myron <[email protected]>
Signed-off-by: monai-bot <[email protected]>
Co-authored-by: monai-bot <[email protected]>
Signed-off-by: KumoLiu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants