-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Regarding L2 norm clamping in Diffusion Prior #68
Comments
Also, here we multiply with a scale without first doing l2norm. https://github.com/lucidrains/DALLE2-pytorch/blob/main/dalle2_pytorch/dalle2_pytorch.py#L986 which is ok if we use XClip because we are doing l2norm here. https://github.com/lucidrains/DALLE2-pytorch/blob/main/dalle2_pytorch/dalle2_pytorch.py#L180 But, we are not doing l2norm when using OpenAI CLIP. https://github.com/lucidrains/DALLE2-pytorch/blob/main/dalle2_pytorch/dalle2_pytorch.py#L274-L275 |
https://github.com/lucidrains/DALLE2-pytorch/blob/main/dalle2_pytorch/dalle2_pytorch.py#L213 ohh, this isn't OpenAIClip, it is actually from however, it is unclear from the CoCa paper whether they l2normed for cosine similarity contrastive learning in the paper, it seems they use layernorms on both image and text cls tokens, but not sure if the l2norm is present |
Sorry, wrong line quote. |
Lol, don't take my word for it, I'm a newbie in diffusion models. |
@xiankgx same, i think we all are, except for a few researchers around the world and maybe @crowsonkb lol you are right! https://github.com/openai/CLIP/blob/main/clip/model.py#L364 they normalized it outside of the encoding functions, let me fix it now 🙏 |
Maybe we can ask crowsonkb for advice. |
Why do we clamp only during sampling and not during training? Shouldn't they be matching? Please enlighten me.
https://github.com/lucidrains/DALLE2-pytorch/blob/main/dalle2_pytorch/dalle2_pytorch.py#L843-L844
https://github.com/lucidrains/DALLE2-pytorch/blob/main/dalle2_pytorch/dalle2_pytorch.py#L859-L860
https://github.com/lucidrains/DALLE2-pytorch/blob/main/dalle2_pytorch/dalle2_pytorch.py#L885-L900
The text was updated successfully, but these errors were encountered: