This package provides some Julia implementations of algorithms for computational optimal transport, including the Earth-Mover's (Wasserstein) distance, Sinkhorn algorithm for entropically regularized optimal transport as well as some variants or extensions.
Notably, OptimalTransport.jl provides GPU acceleration through CUDA.jl and NNlibCUDA.jl.
This package is inspired by the Python Optimal Transport package.
using OptimalTransport
using Distances
# uniform histograms
μ = fill(1/250, 250)
ν = fill(1/200, 200)
# random cost matrix
C = pairwise(SqEuclidean(), rand(1, 250), rand(1, 200); dims=2)
# regularization parameter
ε = 0.01
# solve entropically regularized optimal transport problem
sinkhorn(μ, ν, C, ε)
Please see the documentation pages for further information.
Contributions are more than welcome! Please feel free to submit an issue or pull request in this repository.
Contributors include: