Skip to content

Commit ecaf5a1

Browse files
authored
Fixed misguiding weight mode documentation (#7746)
### Description DeepSupervisionLoss has a small typo in the documentation for 'exp' weight mode. The correct weights for this mode should be starting at 1, not 0 and then decrease by power of two. Might be worth fixing as it made me check the source code. ### 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: Simon Jensen <[email protected]>
1 parent fe733b0 commit ecaf5a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

monai/losses/ds_loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self, loss: _Loss, weight_mode: str = "exp", weights: list[float] |
3333
weight_mode: {``"same"``, ``"exp"``, ``"two"``}
3434
Specifies the weights calculation for each image level. Defaults to ``"exp"``.
3535
- ``"same"``: all weights are equal to 1.
36-
- ``"exp"``: exponentially decreasing weights by a power of 2: 0, 0.5, 0.25, 0.125, etc .
36+
- ``"exp"``: exponentially decreasing weights by a power of 2: 1, 0.5, 0.25, 0.125, etc .
3737
- ``"two"``: equal smaller weights for lower levels: 1, 0.5, 0.5, 0.5, 0.5, etc
3838
weights: a list of weights to apply to each deeply supervised sub-loss, if provided, this will be used
3939
regardless of the weight_mode

0 commit comments

Comments
 (0)