TaoHuang2018 / Neighbor2Neighbor

Neighbor2Neighbor: Self-Supervised Denoising from Single Noisy Images
BSD 3-Clause "New" or "Revised" License
244 stars 37 forks source link

Question about the disabling gradients operations #3

Closed slchenchn closed 3 years ago

slchenchn commented 3 years ago

Hi, I am confused about the code in the training_cript.md:

with torch.no_grad():
    noisy_denoised = network(noisy)

It seems that the disabling gradients operation didn't appear in the paper, and could you please explain the special purpose for doing this?

FunkyKoki commented 3 years ago

Check the paper, for the noisy image with the original size (not sub-sampled), it also needs to go through the Denoising Network and yields the regularizer term.

slchenchn commented 3 years ago

Check the paper, for the noisy image with the original size (not sub-sampled), it also needs to go through the Denoising Network and yields the regularizer term.

But why should it stop the gradients produced by the original size image?

TaoHuang2018 commented 3 years ago

It is an empirical training technique. Stopping the gradient is helpful to stabilize the training. It does not violate the theoretical motivation.

unpairdenosie commented 3 years ago

I'm a little confused about the question. We don't have the groundtruth of the original size image in this paper, so how to get the gradients produced by the original size image?