/contrastive-learning

Contrastive representation learning with PyTorch

Primary LanguagePythonMIT LicenseMIT

Contrastive learning

This repo contains an example of contrastive representation learning. An embedding can be trained in such a way that similar samples (sharing the same label) are pulled together, while dissimilar ones (with different labels) are pushed apart.

2D embeddings of the MNIST test dataset

Notebooks

Installation

pip install -e .

Training

python scripts/main.py fit --config config/mnist.yaml