Added focal_loss_with_probs and full activation selection in Dice+FL.#8493
Open
j-morano wants to merge 3 commits intoProject-MONAI:devfrom
Open
Added focal_loss_with_probs and full activation selection in Dice+FL.#8493j-morano wants to merge 3 commits intoProject-MONAI:devfrom
j-morano wants to merge 3 commits intoProject-MONAI:devfrom
Conversation
280963a to
dd888de
Compare
…ixes Project-MONAI#8242) Signed-off-by: j-morano <research.msj@gmail.com>
Signed-off-by: José Morano <particular.msj@gmail.com>
Signed-off-by: José Morano <particular.msj@gmail.com>
KumoLiu
reviewed
Aug 7, 2025
| to_onehot_y: bool = False, | ||
| sigmoid: bool = False, | ||
| softmax: bool = False, | ||
| sigmoid_dice: bool = False, |
Contributor
There was a problem hiding this comment.
Hi @j-morano, thanks for the contributions!
We would suggest using deprecated_arg to add such changes.
MONAI/monai/utils/deprecate_utils.py
Line 123 in b92b2ce
You can find an example here:
MONAI/monai/metrics/meandice.py
Line 251 in b92b2ce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8242
Description
Added option to compute Focal Loss (FL) directly from class probabilities instead of logits.
Added parameters to the different loss classes combining Dice and FL to allow choosing the activation function (if any) for FL.
Added corresponding tests passing with
pytest tests/losses/ -v.Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests --disttests.make htmlcommand in thedocs/folder.