Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about the diffusion training process. #28

Open
vfcerexwn opened this issue Mar 21, 2024 · 1 comment
Open

Question about the diffusion training process. #28

vfcerexwn opened this issue Mar 21, 2024 · 1 comment

Comments

@vfcerexwn
Copy link

I'm having difficulty understanding the code you provided. Could you please clarify the following points for me?

  1. Does x_noisy represent noisy images at different steps t?
  2. Is x_recon supervised by another noisy observation of the clean image?
  3. Typically, in diffusion models, isn't noise estimated step by step? But according to this code, we directly estimate the image.
    Thank you for your patience and assistance in clarifying these points.
    “”“
    x_noisy = self.q_sample(
    x_start=x_start, continuous_sqrt_alpha_cumprod=continuous_sqrt_alpha_cumprod.view(-1, 1, 1, 1), noise=noise.detach())
    x_recon = self.denoisor(x_noisy, continuous_sqrt_alpha_cumprod)

    J-Invariance optimization

    total_loss = self.mseloss(x_recon, x_in['X'])
    ”“”
@tiangexiang
Copy link
Collaborator

  1. Yes.
  2. Partly yes. x_recon is supervised by a noisy observation indeed, but it is not a 'clean image' with manually injected noise.
  3. Yes, theoretically, diffusion models infer posterior at each time stamp in order to satisfying the Bayes' equation, to make sure it is theoretically correct. In practice, posterior at each time stamp is obtained via injecting noise (with proper noise scheduler) to a completely denoised image (generated by the denoiser). This practical implementation is adopted in many other code bases as well (e.g. SR3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants