loss function issues
XiongchaoChen opened this issue · 3 comments
Dear developers, I have some questions about the image loss functions in "/tutorials/generative/image_to_image_translation/tutorial_segmentation_with_ddpm.py". The loss is calculated based on the MSE loss between the predictions and the "Gaussian noise", as followed in line 229:
"loss = F.mse_loss(prediction.float(), noise.float())"
Is there any reason for using "Gaussian noise" here as the loss target? Your answer is highly appreciated. @wyli @tvercaut @vfdev-5 @drbeh @Warvito
Also got the same question in understanding the training process
Dear @XiongchaoChen and @gxq1998 , thank you for your question. This point is actually correct. In this tutorial and some of the others using diffusion models, we are using the epsilon parametrisation, where we use the diffusion model's Unet to predict the added noise (similar to what you can find in the "Denoising Diffusion Probabilistic Model" paper https://arxiv.org/pdf/2006.11239.pdf Eq.14).
By having a model capable of learning about the noise added in the diffusion process, we can use these predictions in the denoising process and then generate synthetic images starting from one with pure noise.
Thank you so much for your comments!