vturrisi / solo-learn

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

Why does SimCLR use class_loss in training_step? #230

Closed ChintanTrivedi closed 2 years ago

ChintanTrivedi commented 2 years ago

https://github.com/vturrisi/solo-learn/blob/main/solo/methods/simclr.py#L124

Forgetting why this loss is being added to the nce loss in the training_step, I thought it was only calculated for the validation step or in supcon method.

DonkeyShot21 commented 2 years ago

Hi! Thanks for using solo-learn. Please, search through the issues before posting. The question has already been answered multiple times: https://github.com/vturrisi/solo-learn/issues/174 https://github.com/vturrisi/solo-learn/issues/91 https://github.com/vturrisi/solo-learn/issues/128