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

About Gaussian Meaning #26

Open
delldu opened this issue Dec 1, 2020 · 2 comments
Open

About Gaussian Meaning #26

delldu opened this issue Dec 1, 2020 · 2 comments

Comments

@delldu
Copy link

delldu commented Dec 1, 2020

Hi,
Thanks your good work in advance.
But I notices the followin code:

  1. def gaussian_batch(self, dims):
    return torch.randn(tuple(dims)).to(self.device)
  2. def test(self):
     Lshape = self.ref_L.shape
     input_dim = Lshape[1]
     self.input = self.real_H
     zshape = [Lshape[0], input_dim * (self.opt['scale']**2) - Lshape[1], Lshape[2], Lshape[3]]
     gaussian_scale = 1
     if self.test_opt and self.test_opt['gaussian_scale'] != None:
         gaussian_scale = self.test_opt['gaussian_scale']
     self.netG.eval()
     with torch.no_grad():
         self.forw_L = self.netG(x=self.input)[:, :3, :, :]
         self.forw_L = self.Quantization(self.forw_L)
         y_forw = torch.cat((self.forw_L, gaussian_scale * self.gaussian_batch(zshape)), dim=1)
         self.fake_H = self.netG(x=y_forw, rev=True)[:, :3, :, :]
     self.netG.train()
    

My question is:
What's the meaning with LR + Gaussian Noise to generate HR image ? Is it better than 0 or just for test ?

@JuZiSYJ
Copy link

JuZiSYJ commented Dec 7, 2020

I think the Gaussian noise is to sample the dropped high frequently information

@pkuxmq
Copy link
Owner

pkuxmq commented Dec 7, 2020

Yes, it is to sample from Gaussian noise and inversely recover a sample of possible lost information. Actually 0 is a sample from Gaussian noise, and under the full distribution training (i.e. IRN+), using 0 can also have a similar HR image.

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

3 participants