SupContrast icon indicating copy to clipboard operation
SupContrast copied to clipboard

Update losses.py

Open zhangzhenyu13 opened this issue 3 years ago • 3 comments

avoid nan loss in SupCon

zhangzhenyu13 avatar Jul 23 '21 01:07 zhangzhenyu13

Nan loss will results in updating failure, please check my modifications.

zhangzhenyu13 avatar Jul 23 '21 01:07 zhangzhenyu13

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

3koozy avatar Nov 03 '21 12:11 3koozy

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?

Rainwind1995 avatar Mar 10 '22 03:03 Rainwind1995