SupContrast
SupContrast copied to clipboard
Update losses.py
avoid nan loss in SupCon
Nan loss will results in updating failure, please check my modifications.
Thank you highlighting this issue :). I was trying to quickly use the losses.py into my project (which is lacking the SupCon augmentation process that leads to having 1 sample of certain class in the batch) which results in NAN loss.
I will try to use your version and get feedback.
many Thanks
Nan loss will results in updating failure, please check my modifications.
Hello, the code provided by the author only has the train() function, but there is no test() function. How to implement this? can you tell me?