Open wzou96 opened 1 year ago
The same question. I guessed the author was going to test different sampling algorithms which were not publicly recognized. I thought that the logic of the code should be corrected manually according to the original algorithm. And I've done it and suggested the sampling code did not correspond to the paper of DDPM.
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.meantype='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.meantype= '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(xt, t), x{0}, reduction='none')?