zer0int / CLIP-fine-tune

Fine-tuning code for CLIP models
MIT License
166 stars 8 forks source link

Compute Cosine Similarity is different from openai_clip , why #10

Closed Johnson-yue closed 2 months ago

Johnson-yue commented 2 months ago

your code is "/ model.logit_scale().exp" https://github.com/zer0int/CLIP-fine-tune/blob/2df5d36e8e5b9e65ed66632e4b552e39ed8be50d/ft-D-eval-model-on-my-finetune-dataset.py#L91

but in openai_clip is " * model.logit_scale().exp" https://github.com/openai/CLIP/blob/dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1/clip/model.py#L366-L368