Home/Data & Retrieval/pytorch-metric-learning
pytorch-metric-learning logo

pytorch-metric-learning

KevinMusgrave/pytorch-metric-learning

Easily implement deep metric learning in applications using PyTorch

GraphCanon updated Sep 20, 2026 · GitHub synced Sep 20, 2026

54views this month

6.3k stars658 forksLast push Aug 17, 2025 Python MIT

Decision brief

PyTorch Metric Learning is specifically tailored for those leveraging PyTorch and interested in applications that require distance-based learning approaches like computer vision or self-supervised learning tasks.

Good fit when

  • When you are working with the PyTorch framework and intend to implement deep metric learning techniques.
  • For projects requiring image retrieval or classification where embeddings generated through contrastive learning can improve performance.

Avoid when

  • Avoid if you are not working within the PyTorch framework and prefer to use another deep learning library as this tool is tightly integrated with PyTorch.
  • If your project requires a less modular setup, where customization might be more cumbersome due to pytorch-metric-learning's design towards flexibility and modularity.
Hosting:
library - Provides functions for implementing deep metric learning models within PyTorch.
Pricing:
freemium - Free to use under the MIT license, with no direct costs but may require resource investment for implementation and support.

Observed Jul 12, 2026 · Source: enrich:decision_facts

Verify the decision

Maintenance and security

Full trust report
Maintenance
Dormant (398d since push)
As of Sep 20, 2026
Provenance
Not a fork · Personal account
As of Sep 20, 2026
Security (OSV)
No lockfile
As of Jul 11, 2026

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Install

pip install pytorch-metric-learning
PyPI

How it fits your stack(1)

Typed graph edges - alternatives, integrations, successors, and dependencies. Ranked by relationship type, not raw GitHub stars.

Relationship graph

Optional deeper exploration of typed edges and category neighbours.

Similar tools

Same-category neighbours not already linked as typed edges.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

A flexible and modular framework for deep metric learning that simplifies integration into various machine learning projects, particularly under the PyTorch framework.

Capability facts

Languages
python

Source: github.language · Sep 20, 2026

Categories

Compatibility

Sourced claims from the README excerpt - not unsourced marketing copy.

Python runtimePython

Source: README excerpt (regex_v1, Sep 20, 2026)

```python from pytorch_metric_learning import losses
Source link

Tags

README

<h1 <a href="https://github.com/KevinMusgrave/pytorch metric learning" <img alt="PyTorch Metric Learning" src="https://github.com/KevinMusgrave/pytorch metric learning/blob/master/docs/imgs/Logo2.png" </a </h1 <p align="center" <a href="https://pypi.org/project/pytorch metric lea...

For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.