Li-Tong-621 / DMID

Stimulating the Diffusion Model for Image Denoising via Adaptive Embedding and Ensembling
18 stars 0 forks source link

why return xs[0][-1] instead of xs[1][-1] in sample_image function in main_for_real.py #4

Closed KaiyuSubtleRD closed 2 months ago

KaiyuSubtleRD commented 2 months ago

Thanks for providing the code for your paper and the results are impressive! However, I am confused about why you return xs[0][-1] instead of xs[1][-1] in sample_image function in main_for_real.py. The x0_preds looks more like the output from the diffusion process compared to xs. I would appreciate it if you could help me on this!

Li-Tong-621 commented 2 months ago

Hi. I guess you mean this: xs[0][-1] ('xs') is the list for 'xt_next'. xs[1][-1] ('x0_preds') is the list for 'x0_preds'. This part of the understanding is correct。

'xt_next' adds additional noise on 'x0_preds'. In the final iteration, the added noise is zero, so if we want to return the final predicted image (if last:), we can either return xs[0][-1] ('xt_next[-1]') or xs[1][-1] ('x0_preds[-1]').

If this was helpful, feel free to give a star.

KaiyuSubtleRD commented 2 months ago

thanks, very helpful!