taoyang1122 / pytorch-SimSiam

A PyTorch re-implementation of the paper 'Exploring Simple Siamese Representation Learning'. Reproduced the 67.8% Top1 Acc on ImageNet.
Apache License 2.0
78 stars 8 forks source link

Why not use F.cosine_similarity #4

Closed ruotianluo closed 3 years ago

ruotianluo commented 3 years ago

Hi, I comment out using cosine_similarity by pytorch, what is the reason for that?

taoyang1122 commented 3 years ago

No specific reasons. They should be equivalent. I tried both but just left the one which is the same as the paper.

ruotianluo commented 3 years ago

For some reason, I do think cosine_similarity is problematic, but I am using mixed precision.