Conversation
|
/black |
Signed-off-by: monai-bot <[email protected]>
There was a problem hiding this comment.
thanks, do you think the component names should have _3d in them? all the logic seems to be coupled with three spatial dimensions.
e.g.
MONAI/monai/networks/layers/filtering.py
Lines 117 to 121 in 30b2b11
monai/csrc/filtering/trainable_joint_bilateral/jbf_layer_cpu_backward.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Fabian Wagner <[email protected]>
|
Do you mean renaming them to, e.g., sigma_3d_x etc? If you think that makes the code more readable I can do that. |
|
I think in general the question is, as a user looking at this set of components MONAI/monai/networks/layers/filtering.py Lines 18 to 20 in 2bcb52c the underlying concepts are very similar but the input argument styles are different... ideally the signatures should be unified, but maybe that's out of the scope of this PR. so I'm thinking alternatively if we could rename the new components as |
|
So, the inputs to the MONAI/monai/networks/layers/filtering.py Lines 234 to 238 in 5c778ad However, you are right, the underlying C++/Cuda code operates on three dimensions. Though, I just recognized we should maybe make the spatial sigma parameters a tuple input like sigma_spatial=(sigma_x, sigma_y, sigma_z) and then check during layer initialization if len(sigma_spatial) equals the spatial dimensions of the input image/guidance tensors, right? This would make the layer flexible for 1D, 2D, and 3D inputs.
|
|
agreed, if it's renamed to |
Signed-off-by: Fabian Wagner <[email protected]>
|
Great, I just refactored the spatial_sigma initializations accordingly. |
Signed-off-by: monai-bot <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
|
/build |
|
/build |
Fixes #5867.
Description
I integrated the trainable joint bilateral filter layer (TJBF) in the MONAI repository as a new PyTorch filter layer. The TJBF contains an analytical gradient derivation toward its filter parameters, its guidance image, and its noisy input image which enables gradient-based optimization within the PyTorch graph. See here for more details on the gradient derivation. Unit tests were added that check the filter output as well as the gradient computations.
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests --disttests.make htmlcommand in thedocs/folder.