mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[GH-ISSUE #31] Computing target matrix differently #28
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openai/CLIP#28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nishanthcgit on GitHub (Feb 1, 2021).
Original GitHub issue: https://github.com/openai/CLIP/issues/31
Now I realize that the released models and the model from the keras code examples are different, and are possibly trained differently. As far as I can see, as per this issue the openai CLIP model uses a target matrix of torch.eye(batch_size), while in the keras code examples:
So the target in case of the image and caption not being matched isn't a 0 but the average of the distances between the image embeddings and text embeddings. I realize these are 2 different approaches to train the model but do you think setting the target to be the average instead of just a zero might help convergence/accuracy?
@jongwook commented on GitHub (Feb 1, 2021):
The linked Keras example is not affiliated with us, and it seems that they used quite different architecture choices, such as using pre-trained Xception and BERT models, as opposed to training ViT/ResNet and autoregressive transformer from scratch.
Although we haven't experimented with their target matrix, I suspect that it'll be more difficult to train from scratch because the within-domain similarity is not as informative as the case of using pre-trained models; but I'm happy to be corrected on this. It'd be slower to compute since it's no longer one-hot labels.
@nishanthcgit commented on GitHub (Feb 3, 2021):
Ok, I think I understand what you mean. If I do get to train and try it out, I will tell you about it! Thanks a lot.
@dragen1860 commented on GitHub (Apr 1, 2021):
Dear author:
Thanks for this great open source work! i would like to here some invaluable suggestion from you about the following factors:
please feel free to give some general ideas about above factos.
Thank you very much.