Skip to content
PyRank
  • Search
  • PyPI
  • GitHub
  • Insights
  • Compare
  • Advisories
  • Ecosystem
  • About

Contrastive Learning Python Packages

Python packages with the GitHub topic contrastive-learning. Sorted by monthly downloads, with stars and forks.
KevinMusgrave
pytorch-metric-learning

Train and evaluate embeddings for similarity search with PyTorch. Includes contrastive losses, hard example mining, samplers, and retrieval metrics.

1.9M 6K 664
lightly-ai
lightly

A python library for self-supervised learning and latent world models on images.

132K 4K 381
lightly-ai
lightly-utils

A python library for self-supervised learning and latent world models on images.

79K 4K 381
lucidrains
x-clip

A concise but complete implementation of CLIP with various experimental improvements from recent papers

27K 727 49
lucidrains
contrastive-rl-pytorch

Contrastive Reinforcement Learning

5K 74 5
SEOYUNJE
deepclip

Region-Aware Face Forgery Artifact Description with Contrastive Language-Image Pre-training

3K 2 1
RElbers
info-nce-pytorch

PyTorch implementation of the InfoNCE loss for self-supervised learning.

3K 617 43
tensorflow
tfsim-nightly

Metric Learning for Humans

3K 1K 105
lucidrains
coca-pytorch

Implementation of CoCa, Contrastive Captioners are Image-Text Foundation Models, in Pytorch

2K 1K 89
jgraving
selfsne

Self-Supervised Noise Embeddings (Self-SNE) for dimensionality reduction and clustering

2K 160 10
AdaptiveMotorControlLab
cebra

Learnable latent embeddings for joint behavioral and neural analysis - Official implementation of CEBRA

1K 1K 103
tensorflow
tensorflow-similarity

TensorFlow Similarity is a python package focused on making similarity learning quick and easy.

1K 1K 105
Optimization-AI
libauc

LibAUC: A Deep Learning Library for X-Risk Optimization

1K 323 44
PeterPonyu
clop-dit

CLOP-DiT: structured-metadata-conditioned single-cell latent generation via contrastive language-omics pretraining and Diffusion Transformers (Array, 2026)

1K 1 0
unum-cloud
uform

Distributed training & inference for multimodal perception: shared embeddings across text, images, video, audio, code & graphs from 64 to 1024 dimensions 🖼️

938 1K 77
PeterPonyu
mccvae

Islands and Bridges: Momentum Contrastive Coupling Unifies Discrete and Continuous Structure in Single-Cell Omics

905 2 0
DAMO-NLP-SG
inf-cl

[CVPR 2025 Highlight] The official CLIP training codebase of Inf-CL: "Breaking the Memory Barrier: Near Infinite Batch Size Scaling for Contrastive Loss". A super memory-efficiency CLIP training scheme.

764 287 13
audrina-ebrahimi
ak-ssl

A python library for self-supervised learning

609 12 2
qdrant
quaterion

Similarity Learning fine-tuning framework

590 665 47
Li-Chenqhao
dannce-density

Research code for DANNCE, a data-augmented contrastive learning method for nonparametric density estimation (JMLR 2026).

484 2 0
StatBiomed
finest

FineST: Fine-grained Spatial Transcriptomic

447 37 2
4AI
langml

A Keras-based and TensorFlow-backend NLP Models Toolkit.

440 12 1
gao-lab
cell-decipher

DECIPHER for learning disentangled cellular embeddings in large-scale heterogeneous spatial omics data

439 27 1
dada8899
guarded-llm

Beyond Semantic Similarity: Contrastive Learning for Cross-Domain Structural Isomorphism Detection. First benchmark dataset (SIBD) + fine-tuned embedding model + large-scale cross-domain discovery pipeline.

425 2 3
    • Original data from PyPI, GitHub, and OSV; downloads served through ClickHouse
    • Sources & methodology