KernelGAN icon indicating copy to clipboard operation
KernelGAN copied to clipboard

Random noise added to real and simulated patch before passing Discriminator

Open a2bc opened this issue 7 months ago • 2 comments

Hi, Thanks so much for this paper and code. I track the code and see that: In kernelGAN.py d_pred_fake = self.D.forward((g_output + torch.randn_like(g_output) / 255.).detach())

In data.py

if not for_g:  # Add noise to the image for d
            crop_im += np.random.randn(*crop_im.shape) / 255.0

there is a Gaussian random noise with mean = 0 and std = 1/255 added to both the fake and real patches before passing to the Discriminator.

I read the paper and don't see any information about this trick. Can you give me some hints/motivations why you need this noise ? Thanks !

a2bc avatar May 28 '25 09:05 a2bc