MONAI
MONAI copied to clipboard
Added focal_loss_with_probs and full activation selection in Dice+FL.
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
- [ ] Non-breaking change (fix or new feature that would not break existing functionality).
- [x] Breaking change (fix or new feature that would cause existing functionality to change).
- [x] 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. - [x] In-line docstrings updated.
- [ ] Documentation updated, tested
make htmlcommand in thedocs/folder.