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

Some questions about the file diffusion.py #9

Open
wzou96 opened this issue Dec 8, 2022 · 1 comment
Open

Some questions about the file diffusion.py #9

wzou96 opened this issue Dec 8, 2022 · 1 comment

Comments

@wzou96
Copy link

wzou96 commented Dec 8, 2022

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')?

@crazyn2
Copy link

crazyn2 commented May 12, 2024

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.

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

2 participants