-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
VQ-Diffusion #319
Comments
Hi @patrickvonplaten, would love to take this up! |
This would be great! Let me know if you need any help :-) To begin with I think we should try to get it running with the original codebase and then port the code to |
Hey @unography awesome! Happy to help here if you have any questions. |
Any progress here @unography ? Do you already have an open PR :-) Otherwise let's maybe open it again to the community |
Hi, I will be happy to contribute / collaborate on this :) |
Hi @patrickvonplaten, unfortunately, I've been unable to spend time on this right now due to some other commitments, we can open this up again to the community |
No worries! @345ishaan would you be interested in giving it a go? |
@patrickvonplaten Yes, happy to start with this. Do you have any documentation / suggestions / reference CLs on how to quickstart? |
Update: I was getting familiarized with the paper and author's code. I also checked how other models are integrated into diffuser's pipeline for inference only mode, so plan to do the same for VQ-Diffusion as next step using original code impln. |
That's awesome, @345ishaan! Let us know if you need any help :) |
Hello, super sorry wasn't aware someone was already working on this! I ported the VQVAE for the ITHQ dataset. Would love to help contribute if possible :) I put up a draft PR #658 for the VQVAE with docs on how to compare it against VQ-diffusion. Is the standard to wait until the whole pipeline is complete before merging anything, or is it ok to incrementally merge functionality? I.e. for VQ-diffusion, it might be easier to get the individual autoencoders to work one at a time in their own commits before moving on to the rest of the model. Any advice is appreciated, thanks! |
Hmm ok, if you have crossed the finish line, then go ahead! I was mostly working on adding the implentation to diffusers in inference mode. If you need any help further, happy to collaborate. Going forward, what is the best way to avoid such overlaps? I thought it was via proposing/updating through issues. |
@345ishaan definitely not over the finish line, just ported the autoencoder for one of the models! Happy to collaborate :) |
SG! I will check your CL. Do you want to chat over discord? |
@cientgu @zzctan Could I have some help parsing q_posterior? I believe it's computing equation 11 in log space, but I still have a few questions. I understand it's adapted from https://github.com/ehoogeboom/multinomial_diffusion/blob/9d907a60536ad793efd6d2a6067b3c3d6ba9fce7/diffusion_utils/diffusion_multinomial.py#L171-L193 which provides the initial derivation that makes sense.
However, the later comment is a bit vague :)
Because it seems like the actual equation it's using is Additional questions,
Lmk if any of that wasn't clear, thank you! |
@williamberman I will be able to take some tasks today and tomorrow. I just checked your CL, it seems like you ported the vq-vae encoder there. Do you want to chat over discord to split tasks? My username is 345ishaan#9676 |
pinged you in discord @345ishaan! |
Have you figure out questions here ? I am also confused about that the actual computation seems to be q(xt+1 | xt) * q(xt-1 | x0) / q(xt | x0) |
Hey @Zeqiang-Lai I did actually figure out what was going on here! This class is heavily commented
I reverse engineered it through trial and error and a lot of whiteboard markers! I don't remember all of it exactly, but the main components are doing the calculation in log space for numerical stability and avoiding a logspace matmul for which there's no memory efficient pytorch kernel. A few of the other components are just cheeky linear algebra. I later discovered that there's an explanation in the appendix of the multinomial diffusion paper. I didn't read it exhaustively but from skimming, it looks like it's on similar material. https://arxiv.org/pdf/2102.05379.pdf |
@Zeqiang-Lai if you have any other questions on the math, feel free to shoot me an email wlbberman@gmail.com |
Model/Pipeline/Scheduler description
VQ-Diffusion is based on a VQ-VAE whose latent space is modeled by a conditional variant of the recently developed Denoising Diffusion Probabilistic Model (DDPM). It produces significantly better text-to-image generation results when compared with Autoregressive models with similar numbers of parameters. Compared with previous GAN-based methods, VQ-Diffusion can handle more complex scenes and improve the synthesized image quality by a large margin.
https://github.com/microsoft/VQ-Diffusion
Open source status
Provide useful links for the implementation
VQ-Diffusion would be a super cool addition to
diffusers
. cc @cientgu and @zzctan .Also cc @patil-suraj here
The text was updated successfully, but these errors were encountered: