← All projects
Training & fine-tuning

PyTorch Metric Learning

A Python toolkit that helps programmers train AI models to judge how similar two things are.

What it does

PyTorch Metric Learning is a code library for "metric learning", a way of teaching an AI model to place similar items close together and different items far apart. This is useful for tasks like finding matching images or grouping similar products.

It works with PyTorch, a popular toolkit for building AI models. It offers ready-made loss functions (formulas that tell the model how wrong it is), "miners" that pick out especially hard examples to learn from, and tools to train and test models.

The library is split into separate parts that can be used on their own or together. It also includes a way to download common example datasets and example notebooks that can run on Google Colab, a free online coding service.

Who it's for

Programmers and researchers who build AI models in PyTorch and need them to measure similarity between items.

Can I use it without coding?

Developers only. It is a Python library that you use by writing code inside your own training programs. New to this? Start here.

Can I run it?

Cost
FreeNothing to pay or sign up for.
Runs on
Windows, Linux, Cloud
Privacy
Runs on your own device: your data stays with you
API key
Not needed

Try it

Using Claude Code, Cursor or another AI coding assistant? Paste the prompt and it will walk you through the setup.New to this?

Before you install

  • Only download from the official GitHub page. Copies with similar names exist for many popular projects.
  • Plain-AyI is an independent guide and doesn't host or review the software it lists. Please check each project's official page before installing.
  • License (MIT): Very permissive: free to use, change and share, including for business.
  • More on staying safe