pytorch-metric-learning
pytorch-metric-learning copied to clipboard
Multi-SupConLoss
I implemented the Multi-SupConLoss as mentioned in issue #658.
However, this implementation rewrote a lot of functions because many functions conflicted with the multi-label task such as check_shapes and get_matches_and_diffs.
Moreover, it seems that the cross-batch memory does not support the Multi-SupConLoss. I found that to support the Multi-SupConLoss I need to modify a bunch of code which will potentially affect other well-developed functions.
So, I tried to add the function I needed to multilabel_supcon_loss.py and didn't make any changes to other well-developed functions.
I also tested the use-case and compared the result with repo. The result looks good except the cases ran on Float16.