CLIP contrastive loss
Implement the CLIP-style contrastive loss for a batch of matching image and text embeddings.
Build the image-text similarity matrix, take the cross-entropy against the diagonal (each image's match is its own text) in both directions, images to texts and texts to images, and average the two. Discuss normalizing the embeddings and the temperature.
No answer yet. Write the first one; the best answer gets endorsed.
