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

Issues with Conditional Sampling #75

Open
aashishrai3799 opened this issue Feb 20, 2024 · 3 comments
Open

Issues with Conditional Sampling #75

aashishrai3799 opened this issue Feb 20, 2024 · 3 comments

Comments

@aashishrai3799
Copy link

aashishrai3799 commented Feb 20, 2024

Hi,

Consider the following lines of code:

cond1 = model.encode(batch)
xT = model.encode_stochastic(batch, cond1, T=50)
pred = model.render(noise= xT , cond=cond1, T=20)
#xT_rand = torch.rand(xT.shape, device=device)
#pred_rand = model.render(noise= xT_rand , cond=cond1, T=20)

The above autoencoding works perfectly as expected. However, instead of using xT, if I use xT_rand with the same cond1, I get nothing but noise in the predicted image. Could you please help me understand why that happens? As mentioned in the paper, most of the semantic information is captured in z_sem, so why does it fails in this case?

Your response will be greatly appreciated.

Thank you!

@aashishrai3799 aashishrai3799 changed the title Issues with Sampling Issues with Conditional Sampling Feb 20, 2024
@phizaz
Copy link
Owner

phizaz commented Feb 21, 2024

torch.rand is a uniform random which is not what the diffusion model trained for. Please use torch.randn.

@aashishrai3799
Copy link
Author

aashishrai3799 commented Feb 22, 2024

Hi, thank you for your quick response. Despite using torch.randn, I get distorted output. Here's an example:

(input - noise - prediction)
image

And this happens for all the examples I tested, not just this one. Do you have any insights into why this is happening?

Thanks again!

@phizaz
Copy link
Owner

phizaz commented Feb 22, 2024

I'm not sure what's the usecase here. Can you tell me what's the big picture? This doesn't seem like the usecase mentioned in the paper.

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