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

[CLIP] fix logit_scale init #13436

Merged
merged 2 commits into from
Sep 8, 2021

Conversation

patil-suraj
Copy link
Contributor

@patil-suraj patil-suraj commented Sep 6, 2021

What does this PR do?

This PR fixes the initialization of logit_scale parameter as per the original CLIP implementation .

Also, the initial value of logit_scale needs to be carefully tuned for CLIP training, so this PR, adds a logit_scale_init_value as a config parameter, so users could pass different init values as per their training.

Fixes #13430

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we run a test training to verify that this gives better results?

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this (and +1 for the test)!

@patil-suraj patil-suraj merged commit c164c65 into huggingface:master Sep 8, 2021
@patil-suraj patil-suraj deleted the fix-logit-scale-init branch September 8, 2021 08:51
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

Successfully merging this pull request may close these issues.

Difference between logit_scale initialisation in Transformers CLIP and the original OpenAI implementation.
3 participants