{"categories":[{"label":"Artificial Intelligence","url":"https://skillfed.io/packages/category/scientific-engineering-artificial-intelligence/2"}],"enrichment":{"capability":"Provides metric learning loss functions, miners, and evaluation tools for training deep neural networks to learn embeddings where similar items cluster together and dissimilar items separate.","skillfed_tags":["metric-learning","embeddings","contrastive-learning"],"use_cases":["Train face recognition or person re-identification models where embeddings must cluster by identity.","Build product recommendation systems by learning embeddings where similar items are nearby in embedding space.","Implement image retrieval systems where query and gallery images are ranked by embedding similarity.","Train self-supervised models using contrastive objectives without labeled data.","Evaluate embedding quality on standard benchmarks using built-in accuracy calculators and testers."],"what_it_does":"pytorch-metric-learning is a PyTorch library for training neural networks to produce embeddings where semantically similar inputs are close together and dissimilar ones are far apart. It provides loss functions (TripletMarginLoss, SmoothAPLoss, ArcFace variants, and others), hard-pair miners that identify difficult training examples, distance metrics, and evaluation tools. The library is modular: each component\u2014losses, miners, distances, reducers, regularizers\u2014can be used independently or composed together. It supports both supervised learning (where labels define similarity) and self-supervised approaches like MoCo-style momentum encoding.\n\nYou integrate it into a standard PyTorch training loop by computing embeddings from your model, passing them to a loss function along with labels, and optionally using a miner to focus on hard examples. The library handles the combinatorial complexity of forming triplets or pairs from batches automatically. It includes convenience modules for dataset downloading (CUB200, Cars196, INaturalist, Stanford Online Products), training workflows, and accuracy calculation on standard benchmarks.","worth_installing":"Yes, with a minor caveat on maintenance timing. The library is well-established (6336 stars, top 5000 PyPI), permissively licensed, and has low install friction. Its modular design and comprehensive loss/miner suite make it the standard choice for metric learning in PyTorch. However, the last release was 362 days ago; if you need very recent bug fixes or features, verify that the current version addresses your use case or check the development branch."},"id":"pytorch-metric-learning","links":{"html":"https://skillfed.io/packages/pytorch-metric-learning","md":"https://skillfed.io/packages/pytorch-metric-learning.md","pypi":"https://pypi.org/project/pytorch-metric-learning/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2025-08-17","license_spdx":null,"license_treatment":"permissive","name":"pytorch-metric-learning","python_support":"supports_current","summary":"The easiest way to use deep metric learning in your application. Modular, flexible, and extensible. Written in PyTorch."},"popularity":{"monthly_downloads":3692753,"position":2526,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"2.9.0"}
