Skip to content

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

@Le2Hu

Description

@Le2Hu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions