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

PC sampler mismatched? #50

Open
minh-hai-nguyen-712 opened this issue Nov 16, 2023 · 3 comments
Open

PC sampler mismatched? #50

minh-hai-nguyen-712 opened this issue Nov 16, 2023 · 3 comments

Comments

@minh-hai-nguyen-712
Copy link

Hello, thanks for your interesting work!

I have a question about your implementation of PC sampler:

  def pc_sampler(model):
        with torch.no_grad():
            # Initial sample
            x = sde.prior_sampling(shape).to(device)
            timesteps = torch.linspace(sde.T, eps, sde.N, device=device)
      
            for i in range(sde.N):
                t = timesteps[i]
                vec_t = torch.ones(shape[0], device=t.device) * t
                x, x_mean = corrector_update_fn(x, vec_t, model=model)
                x, x_mean = predictor_update_fn(x, vec_t, model=model)
      
            return inverse_scaler(x_mean if denoise else x), sde.N * (n_steps + 1)

Why you start by correcter instead of predictor as in Alg 1. of your original paper? Is there any reason?
Thank you very much!

@LiChenda
Copy link

I have the same question after reviewing these lines of code. @NguyenHai7120 Have you figured it out?

@Long-louis
Copy link

Is it because after the prior sampling, you need to run a corrector first?

@PhilippHoellmer
Copy link

Same question here. I guess it makes somewhat sense to use the corrector on the prior sampling. But even then the corrector is never applied to the final sample?

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

4 participants