vturrisi / solo-learn

solo-learn: a library of self-supervised methods for visual representation learning powered by Pytorch Lightning
MIT License
1.42k stars 185 forks source link

Where did you do normalization for supervised contrastive learning? #307

Closed NoTody closed 1 year ago

NoTody commented 1 year ago

Hi, I couldn't find where did you do normalization for supervised contrastive learning implementation. Did you ignore it? In original paper, they did normalization after the projector as this line here https://github.com/HobbitLong/SupContrast/blob/331aab5921c1def3395918c05b214320bef54815/networks/resnet_big.py#L185 .

DonkeyShot21 commented 1 year ago

In the loss function: https://github.com/vturrisi/solo-learn/blob/main/solo/losses/simclr.py#L41