Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.