Conversation
…tyle and unit tests passed. Signed-off-by: Fabian Wagner <[email protected]>
Signed-off-by: Fabian Wagner <[email protected]>
|
/black |
Signed-off-by: monai-bot <[email protected]>
|
/black |
zehuanw
left a comment
There was a problem hiding this comment.
Hi @faebstn96 , I read your code in the past two weeks and it looks great! Just left two comments directly on the code.
One more question: It seems that most of the logics in the backprop is the same to forward (gaussianKernel_xyz are also the same?). Does it make sense to generate filter_kernel_back (in bf_layer_gpu_backward.cu) directly in forward and compute gradientOutputTensor with gradientInputTensor && the filter? If feasible, backward code will be much simpler.
monai/csrc/filtering/trainable_bilateral/bf_layer_gpu_backward.cu
Outdated
Show resolved
Hide resolved
|
Hi @zehuanw,
You are right, the calculation of the spatial Kernels gaussianKernel_xyz is the same in the forward and backward and could be calculated in the forward only and then reused in the backward. However, the intensity range kernel needs to be calculated on the fly as the input intensities change locally (this is the more complex part of the calculation within the CUDA kernels). |
This reverts commit 68ff70b.
This reverts commit 68ff70b. Signed-off-by: Fabian Wagner <[email protected]>
Signed-off-by: Fabian Wagner <[email protected]>
Signed-off-by: monai-bot <[email protected]>
|
/build |
wyli
left a comment
There was a problem hiding this comment.
thanks @faebstn96 and the comments from @zehuanw, the PR looks nice and I'm merging it soon. the fact that the variable notations are consistent with the descriptions in the paper makes the code logic easy to follow...
|
/build |
Fixes #1840 .
Description
I integrated the trainable bilateral filter layer (TBF) in the MONAI repository as a new PyTorch filter layer. The TBF contains an analytical gradient derivation toward its filter parameters 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 computation.
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests --disttests.make htmlcommand in thedocs/folder.