Open ankan8145 opened 5 months ago
@ankan8145 x = torch.randn((n, 3, self.img_size, self.img_size)).to(self.device)
is a random noise with n=12
, channels=3
and self.img_size=64
(probably). Random sampling (after training the DDPM) is carried out by starting from pure noise and reversing the time steps (i.e., starting from 1000 and finishing at 1).
The outcome is realistic-looking images obtained from pure noise only.
Can anyone explain this fuction . In the line 'x = torch.randn((n, 3, self.img_size, self.img_size)).to(self.device)', you create a random image then from that image you predict the noise ( i.e. predicted_noise = model(x, t) ). Are you tring to create an image from a random tensor ??