A Binary Contrastive Learning Encoder

A contrastive learning encoder inspired by Google’s “Supervised Contrastive Learning” paper. I used the two papers from Google below:

Unsupervised Contrastive Learning
Supervised Contrastive Learning

The gist of this application is that I changed the contrastive learning loss to learn the positive class rather than learning all classes. Please redirect to my Github repo from the link.