-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Hello! Thanks for your great job for the implementation of DDPM with pytorch. It is my first time to do some research on diffusion model. After reading the file diffusion.py, I have several questions about the code and wonder I got some wrong understanding.
(1)In Line 144, there is a operation to restrict the value of x_{0} into (-1,1), but this function only return the value of mean and variance. I wonder if this line is unnecessary?
(2)I also have some problems with the function of the variable self.mean_type. I can understand that if self.mean_type='epsilon', the model can predict the epsilon_{theta} with loss function in Line 42: loss = F.mse_loss(self.model(x_t, t), noise, reduction='none'). I wonder if self.mean_type= 'xprev' or 'xstart', the loss function used to train the model should be changed as the model is required to predict the original sample x_{0} and former sample x_{t-1}? For example, if self.mean_type='xstart', loss = F.mse_loss(self.model(x_t, t), x_{0}, reduction='none')?