Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why add noise and how to calculate the logdet of this operation #57

Open
Le2Hu opened this issue Jul 29, 2022 · 0 comments
Open

Why add noise and how to calculate the logdet of this operation #57

Le2Hu opened this issue Jul 29, 2022 · 0 comments

Comments

@Le2Hu
Copy link

Le2Hu commented Jul 29, 2022

if add_gt_noise:
# Setup
noiseQuant = opt_get(self.opt, ['network_G', 'flow', 'augmentation', 'noiseQuant'], True)
if noiseQuant:
z = z + ((torch.rand(z.shape, device=z.device) - 0.5) / self.quant)
logdet = logdet + float(-np.log(self.quant) * pixels)

According to the lines, uniform noise between [-0.5,0.5) is added into the input image, is the operation necessary? And why the logdet should be updated like this? When I read the paper, I noticed the description in the trainning details section as below, but i am not sure whether it's implemented by the mentioned lines or not.

adding slight random noise to the target image helps the training process and leads to better visual results. We therefore add Gaussian noise with a standard deviation of $\sigma = 4/ \sqrt 3$ to the high-resolution image. In contrast to [21], we do not employ 5-bit quantization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant