Skip to content

Some questions about the file diffusion.py #9

@wzou96

Description

@wzou96

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions