Repository navigation
Releases
Releases · keckj/deblais
deblais 0.2.0
Added
- Costs
|x - y|^p: the optionp(Options::pin C++,p=in Python) solves the transport for any power of the Euclidean distance,p > 0, with every method (closed form on the line forp >= 1). The plan, its cost, the potentials andcertifyuse the same exponent;Plan::precords it. The PyTorch gradients follow the exponent. - The default stays
p = 2, and onlyp = 2keeps the single precision filter of the pricing: its speed is unchanged.
Notes
- The automatic mode is tuned for
p = 2. For another exponent it is slower than the plain simplex up to a few thousand points, and the best method changes from one problem to the next: runtuneonce on a typical problem and reuse its options. Measurements in the documentation. wasserstein2keeps the squared distance and refuses anotherp.
Full changelog: v0.1.0...v0.2.0
deblais 0.1.0
First version: exact optimal transport between point clouds for the squared Euclidean cost, as a header-only C++17 library and a Python package.
Added
- C++ library (
#include <deblais/deblais.hpp>):deblais::solvereturns an optimal sparse plan, its cost and the Kantorovich potentials, in dimension 1 and above. No dependency; OpenMP is used when available. - Four exact methods: closed form on the line, network simplex with column generation (the cost matrix is never stored), multiscale warm start, and parallel sweeps of a domain decomposition. An auction replaces the simplex on the levels of assignment problems; it gives the problem back to the simplex when it starts a price war (clustered clouds).
- Automatic mode: the method, the arithmetic of the flows (integer or real) and the parameters are chosen from the dimension, the sizes and the masses.
deblais::recipetells what will run. - Tuning:
deblais::tune(deblais.tunein Python) times solves of the given clouds and returns the fastest options on this machine (method, threads, coarsest level of the multiscale start, auction, sweeps). - Certificates:
deblais::certifymeasures the marginals, the duality gap and the dual feasibility of a plan. - Python package:
deblais.solveanddeblais.wasserstein2for NumPy arrays and PyTorch tensors (any device, differentiable cost), with sparse, dense, barycentric map and assignment views of the plan. - The Python module shares the OpenMP runtime of PyTorch when PyTorch is installed.
- Documentation, with a page on the twin project remblais (entropic transport on GPUs).
Full changelog: https://github.com/keckj/deblais/commits/v0.1.0