limuloo / PyDIff

[IJCAI 2023 ORAL] "Pyramid Diffusion Models For Low-light Image Enhancement" (Official Implementation)
Other
149 stars 8 forks source link

Confusion about loss. #13

Closed Maydaybye closed 10 months ago

Maydaybye commented 10 months ago

Hi, I'm a little confused about the following regarding the calculation of loss.

  1. the paper says sqrt(1-α¯t/α¯t) > γ to do gradient descent for color offset, but why does it count the loss every time in the first image where the red line is drawn?
  2. Is cs_on_shift calculating the color shift in the second image? cs_on_shift is true, the input to color_fn is x_start_shift. When cs_on_shift is false, the input to color_fn is self.x_recon_detach. I think both inputs are essentially trying to minimize the difference from the ground truth! What is the difference between them? 20231030175429

Really confused /_ \
Looking forward to your help.

limuloo commented 10 months ago

(1) During the final implementation, we found that there is not much performance difference between optimizing the global corrector at all times and optimizing only when sqrt(1-α¯t/α¯t) > γ. However, during inference, this condition must still be met. Anyway, you can set gamma_limit_train as 1.0 to be consistent with the paper. (2) x_recon_detach may have noise. x_start_shift has no noise, which only has color shift.

Maydaybye commented 10 months ago

Thanks for your patience and detailed answers!