PythonOT/POT

POT : Python Optimal Transport

What it solves

This library provides a comprehensive suite of solvers for Optimal Transport (OT) problems. OT is a mathematical framework used to measure the distance between probability distributions, which is highly useful in machine learning for tasks like domain adaptation, comparing datasets, and training generative models.

How it works

It implements a wide range of algorithms—from exact linear programming solvers (like the Earth Mover's Distance) to faster, regularized approximations (like the Sinkhorn algorithm). The library is designed to be hardware-agnostic, offering backends that integrate seamlessly with NumPy, PyTorch, JAX, TensorFlow, and CuPy, allowing these computations to run on both CPUs and GPUs.

Who it’s for

It is intended for researchers and machine learning engineers working on signal processing, computer vision, or deep learning who need to incorporate Wasserstein distances or OT-based loss functions into their models.

Highlights

  • Extensive collection of OT solvers: includes Gromov-Wasserstein, Fused Gromov-Wasserstein, unbalanced OT, and partial OT.
  • Multi-backend support: works natively with PyTorch, JAX, TensorFlow, and NumPy arrays.
  • ML-ready: provides pre-built modules for domain adaptation, Wasserstein barycenters, and Graph Neural Network (GNN) layers.
  • Performance-optimized: includes stabilized Sinkhorn implementations and stochastic solvers for large-scale datasets.

Related

  • Project
  • Project
  • Project
  • Project
  • Project