Commit faaa212
docs: add differentiability warning for Warp with mode='nearest' (#8629)
Fixes #8540 .
### Description
This PR updates the docstring of monai.networks.blocks.Warp to clarify
that mode='nearest' results in zero gradients almost everywhere,
effectively blocking gradient flow in registration training.
### Changes:
Added a note to the Warp docstring about the gradient behavior of
mode='nearest'.
Added a reference to the semi-supervised registration tutorial:
https://github.com/Project-MONAI/tutorials/blob/main/3d_registration/learn2reg_oasis_unpaired_brain_mr.ipynb
### Next Steps (future PR):
Extend VoxelMorph.forward to handle optional label and keypoint
arguments for consistent warping behavior.
### 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`.
- [x] In-line docstrings updated.
- [x] Documentation updated, tested `make html` command in the `docs/`
folder.
---------
Signed-off-by: Kheil-Z <ziadishappy@gmail.com>
Co-authored-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>1 parent 61849bf commit faaa212
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
| |||
0 commit comments