SimCSE-Pytorch icon indicating copy to clipboard operation
SimCSE-Pytorch copied to clipboard

F.cosine_similarity

Open jellyroger opened this issue 2 years ago • 0 comments

---> 12 sim = F.cosine_similarity(y_pred.unsqueeze(1), y_pred.unsqueeze(0), dim=-1) 13 14 # 将相似度矩阵对角线置为很小的值, 消除自身的影响

RuntimeError: cosine_similarity requires both inputs to have the same sizes, but x1 has [64, 1, 768] and x2 has [1, 64, 768]

请教一下这里有什么问题吗

jellyroger avatar Jun 15 '22 12:06 jellyroger