geomloss
Geometric loss functions between point clouds, images and volumes.
What it is and what it does
Geomloss implements geometric loss functions for comparing structured data like point clouds, images, and volumetric data using optimal transport theory and kernel methods. It wraps PyTorch tensors to compute distances and divergences between distributions, making it useful for tasks that need differentiable, geometrically meaningful loss metrics rather than standard Euclidean or statistical measures.
The package is designed for machine learning and scientific computing workflows where you need to optimize over geometric structures. It depends on numpy, scipy, and torch, so it integrates naturally into PyTorch-based pipelines. The code is marked pre-alpha but actively maintained, indicating it is still evolving but usable for research and production work.
Use it for:
- Training generative models (GANs, VAEs) with geometric loss instead of pixel-space or feature-space losses.
- Comparing 3D point clouds in computer vision or robotics applications.
- Computing optimal transport distances between probability measures in statistical learning.
- Shape matching and registration tasks in medical imaging or geometry processing.
- Differentiable metric learning where standard distances are too rigid.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Computes geometric loss functions for comparing point clouds, images, and volumes using optimal transport and kernel methods, built on PyTorch and NumPy.
Yes, if you are working with PyTorch and need geometric or optimal-transport-based loss functions. The pre-alpha status and recent maintenance suggest active development; the low install friction and permissive license make it a low-risk addition. Install only if you have a specific use case for optimal transport or kernel-based metrics—it is not a general-purpose library.
Install
geomloss on PyPI
pip
pip install geomlossuv
uv add geomlosspoetry
poetry add geomlossInstalling geomloss
Before you install
Low install friction with a pure-Python wheel. Marked pre-alpha (Development Status 2) but actively maintained with a recent release. Depends on numpy, scipy, and torch, which are standard scientific Python packages.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install geomloss
import geomloss
# Compute loss between two point clouds using torch tensors
loss = geomloss.SamplesLoss("sinkhorn")
result = loss(cloud_a, cloud_b)
Requires PyTorch (torch) to be installed; geomloss itself does not bundle it. Minimum Python 3.8.
Verify before relying
- Whether the package provides pre-built GPU kernels or relies entirely on PyTorch's backend.
- Performance characteristics and scalability limits for large point clouds or high-dimensional data.
- Availability and quality of documentation beyond the project website.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — numpy, scipy, torch |
| Maintenance | actively maintained — 101 days since the last release |
| First released | |
| Downloads | 158,195/month — #10,731 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: geomloss-0.3.1-py3-none-any.whl
Keywords: kernels, optimal transport, measure, loss, geometry
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
ott-jaxOTT-JAX solves optimal transport…
permissive · top 15,000 on PyPI
POTPOT provides solvers for optimal transport…
permissive · top 15,000 on PyPI
torch-stoiComputes Short Term Objective Intelligibility…
permissive · top 15,000 on PyPI
pytorch-metric-learningProvides metric learning loss functions,…
permissive · top 5,000 on PyPI
imbalance-xgboostWraps XGBoost with weighted and focal loss…
permissive · top 15,000 on PyPI
liger-kernelLiger Kernel provides optimized Triton kernels…
permissive · top 15,000 on PyPI
pytorch-msssimComputes fast, differentiable SSIM and MS-SSIM…
permissive · top 15,000 on PyPI