CLIP
CLIP copied to clipboard
Cosine Similarity Calculation and Number Range Inquiry
So, if we calculate the similarity using ,
similarity = F.cosine_similarity(x, y)
without normalizing the image and text features, the computed cosine similarity will have the same output as
x = x / x.norm(dim=-1, keepdim=True)
y = y / y.norm(dim=-1, keepdim=True)
similarity = x @y.T
Is that correct?