diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

[happy to fix this] Wrong a weighted mean squared error loss

Open aengusng8 opened this issue 3 years ago • 1 comments

https://github.com/huggingface/diffusers/blob/acd317810bc138b3a78fa30e1b3da1006c1d60ad/examples/unconditional_image_generation/train_unconditional.py#L421-L428

  1. Big issue: alpha_t / (1 - alpha_t) is the signal-to-noise ratio (SNR). The weighting scheme snr_weights is different from the paper and doesn't make sense because the weight should be large when t is large (while SNR is small when t is large).
  2. Perception Prioritized Training of Diffusion Models (CVPR 2022) proposed a better weighting scheme. I am happy to implement and open a PR on this weighted MSE loss.

aengusng8 avatar Dec 16 '22 17:12 aengusng8

Hey @aengusng8, I think we're have two different issue here.

1.) states that something is wrong - "the weighting scheme ... is different from the paper" => could you link the paper and show the difference?

2.) Should we maybe open a new issue for this?

patrickvonplaten avatar Dec 20 '22 00:12 patrickvonplaten

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Jan 16 '23 15:01 github-actions[bot]