Scroll AI Now

Open source repo

pytorch-metric-learning

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

By KevinMusgrave · MIT · Python · ★ 6,344

View on GitHubProject siteMore repos in the app

What it is

pytorch‑metric‑learning is an open source tool for retrieval and search with AI, published on GitHub by KevinMusgrave and written mainly in Python. Its maintainers file it under computer‑vision, contrastive‑learning, deep‑learning, deep‑metric‑learning.

In its own words on GitHub: “Train and evaluate embeddings for similarity search with PyTorch. Includes contrastive losses, hard example mining, samplers, and retrieval metrics.”

Who it is for

Teams who want an AI model to answer from their own documents, data or knowledge base, not only from what it learned in training.

How to start

  1. Open the repo and read the README from the top, then the license file.
  2. It is written in Python, so you will usually install it with pip or uv inside a virtual environment.
  3. Its project site, kevinmusgrave.github.io, has documentation and sometimes a hosted version you can try before you install anything.
  4. Pin a release or a commit, so an update does not change how it behaves without you noticing.

Why it is on our list

The facts

LicenseMIT
What the license allowsYou can use, change and ship it, including in paid products. Keep the copyright notice.
Main languagePython
Stars6,344
Topicscomputer‑vision, contrastive‑learning, deep‑learning, deep‑metric‑learning, embeddings
CreatedOctober 23, 2019
Last checkedDecember 2, 2026

Before you use it

Are you the author?

This repo has its own page on Scroll AI Now.
Show it in your README with the badge below.
It links readers back to this page. How the badge works

Featured on Scroll AI Now

Markdown
[![Featured on Scroll AI Now](https://scrollainow.com/badge/featured.svg)](https://scrollainow.com/repos/kevinmusgrave-pytorch-metric-learning/)
HTML
<a href="https://scrollainow.com/repos/kevinmusgrave-pytorch-metric-learning/"><img src="https://scrollainow.com/badge/featured.svg" alt="Featured on Scroll AI Now" height="28"></a>

Related repos

All curated AI repos · Agent skills

Try it in your browser

Today's AI news, one card per swipe.
Free to start.

Open the web app