Stability-AI / stablediffusion

High-Resolution Image Synthesis with Latent Diffusion Models
MIT License
38.33k stars 4.95k forks source link

can someone explain what is p_losses doing? #316

Closed lez-s closed 1 year ago

lez-s commented 1 year ago

in the ldm/models/diffusion/ddpm.py, p_losses function.

if self.parameterization == "x0":
       target = x_start
elif self.parameterization == "eps":
       target = noise
elif self.parameterization == "v":
       target = self.get_v(x_start, noise, t)
else:
       raise NotImplementedError()

why the target is random noise? is it because model try to predict the denoised noise?

lez-s commented 1 year ago

Yes, I think the model output is trying to predict the noise when tilmestep equals t.