mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[GH-ISSUE #301] why using np.arange(n) rather than one-hot as labels? #260
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#260
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 @leviome on GitHub (Nov 10, 2022).
Original GitHub issue: https://github.com/openai/CLIP/issues/301
Thanks for sharing the nice work. But I didn't fully understand the labels usage:
the
logitsis the cosine similarity matrix fornimage-text pairs. But cross entropy loss will make the rows/cols close to [0, 1, 2, 3, ...] (np.arange(n)), leading tologits[0][0]=0, equally the similarity of image[0] and text[0] is getting to 0.But our goal is to enlarge the cosine similarity of image[0] and text[0].
So, could some awesome guys help me understand why using np.arange(n) rather than using one-hot as labels?
@leviome commented on GitHub (Dec 5, 2022):
Ok! I worked it out
@yeknafar commented on GitHub (Feb 18, 2023):
can you expalin this ?