# SlicedWasserstein.jl

SlicedWasserstein.jl is a lightweight Julia package for computations with finite discrete measures using sliced optimal transport.

The package currently provides:

  • a DiscreteMeasure type for finite weighted measures;
  • one-dimensional optimal transport for discrete measures;
  • Monte Carlo estimates of sliced Wasserstein costs;
  • free-support sliced Wasserstein barycenters;
  • sliced Wasserstein k-means clustering.
Note

The package is currently released as v0.1.0. The public API is still evolving.

Installation

using Pkg
Pkg.add("SlicedWasserstein")

Quick start

using SlicedWasserstein

μ = DiscreteMeasure(randn(2, 50))
ν = DiscreteMeasure(randn(2, 50) .+ 1)

SOT(μ, ν; M = 100, seed = 1)
1.230026516195585

Further reading

See Background and methodology for a short introduction to the optimal transport and sliced Wasserstein ideas used by the package.

See API Reference for the documented public interface.

Contents