Skip to content

Commit 81af888

Browse files
committed
Merge branch 'JuliaOptimalTransport:master' into master
2 parents 03ace5b + 72e3e6d commit 81af888

25 files changed

+5199
-5189
lines changed

.JuliaFormatter.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style="blue"

.github/workflows/CompatHelper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
env:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1515
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
16-
run: julia -e 'using CompatHelper; CompatHelper.main(; subdirs = ["", "docs"])'
16+
run: julia -e 'using CompatHelper; CompatHelper.main(; subdirs = ["", "docs", "examples/basic"])'
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: DocsPreviewCleanup
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
cleanup:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout gh-pages branch
12+
uses: actions/checkout@v2
13+
with:
14+
ref: gh-pages
15+
- name: Delete preview and history + push changes
16+
run: |
17+
if [ -d "previews/PR$PRNUM" ]; then
18+
git config user.name "Documenter.jl"
19+
git config user.email "[email protected]"
20+
git rm -rf "previews/PR$PRNUM"
21+
git commit -m "delete preview"
22+
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
23+
git push --force origin gh-pages-new:gh-pages
24+
fi
25+
env:
26+
PRNUM: ${{ github.event.number }}

.github/workflows/Documentation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ jobs:
3131
PYTHON: python
3232
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
3333
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
34+
GKSwstype: nul # avoid (irrelevant) error messages from GR
3435
run: julia --project=docs/ docs/make.jl

.github/workflows/Format.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Format
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
format:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: julia-actions/setup-julia@latest
12+
with:
13+
version: 1
14+
- name: Format code
15+
run: |
16+
using Pkg
17+
Pkg.add(; name="JuliaFormatter", uuid="98e50ef6-434e-11e9-1051-2b60c6c9e899")
18+
using JuliaFormatter
19+
format("."; verbose=true)
20+
shell: julia --color=yes {0}
21+
- uses: reviewdog/action-suggester@v1
22+
with:
23+
tool_name: JuliaFormatter
24+
fail_on_error: true

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ deps/src/
2020
# Build artifacts for creating documentation generated by the Documenter package
2121
docs/build/
2222
docs/site/
23+
docs/src/examples/
2324

2425
# File generated by Pkg, the package manager, based on a corresponding Project.toml
2526
# It records a fixed state of all packages used by the project. As such, it should not be
2627
# committed for packages, but should be committed for applications that require a static
2728
# environment.
28-
Manifest.toml
29+
/Manifest.toml
2930

3031
# Files generated by Jupyter Notebooks
3132
*.ipynb_checkpoints

Project.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
name = "OptimalTransport"
22
uuid = "7e02d93a-ae51-4f58-b602-d97af76e3b33"
33
authors = ["zsteve <[email protected]>"]
4-
version = "0.2.0"
4+
version = "0.2.2"
55

66
[deps]
77
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
8-
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
98
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
10-
LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
119
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1210
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
1311
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1412
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1513

1614
[compat]
1715
Distances = "0.9.0, 0.10"
18-
FillArrays = "0.9, 0.10"
1916
IterativeSolvers = "0.8.4, 0.9"
20-
LazyArrays = "0.18, 0.19"
2117
MathOptInterface = "0.9"
2218
Requires = "1.1"
2319
julia = "1"

README.md

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,51 @@
1-
<a href="http://zsteve.phatcode.net/OptimalTransportDocs/">
1+
<a href="https://juliaoptimaltransport.github.io/OptimalTransport.jl/dev">
22
<img src="images/optimaltransport_logo.png" height="125"><br></a>
33

44
## Optimal transport algorithms for Julia
55

6-
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://zsteve.github.io/OptimalTransport.jl/stable)
7-
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://zsteve.github.io/OptimalTransport.jl/dev)
8-
![CI](https://github.com/zsteve/OptimalTransport.jl/workflows/CI/badge.svg?branch=master)
9-
[![Codecov](https://codecov.io/gh/zsteve/OptimalTransport.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/zsteve/OptimalTransport.jl)
10-
[![Coveralls](https://coveralls.io/repos/github/zsteve/OptimalTransport.jl/badge.svg?branch=master)](https://coveralls.io/github/zsteve/OptimalTransport.jl?branch=master)
6+
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaOptimalTransport.github.io/OptimalTransport.jl/stable)
7+
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaOptimalTransport.github.io/OptimalTransport.jl/dev)
8+
[![CI](https://github.com/JuliaOptimalTransport/OptimalTransport.jl/workflows/CI/badge.svg?branch=master)](https://github.com/JuliaOptimalTransport/OptimalTransport.jl/actions?query=workflow%3ACI+branch%3Amaster)
9+
[![Codecov](https://codecov.io/gh/JuliaOptimalTransport/OptimalTransport.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaOptimalTransport/OptimalTransport.jl)
10+
[![Coveralls](https://coveralls.io/repos/github/JuliaOptimalTransport/OptimalTransport.jl/badge.svg?branch=master)](https://coveralls.io/github/JuliaOptimalTransport/OptimalTransport.jl?branch=master)
11+
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
1112

12-
![example histogram](example.png)
13+
This package provides some [Julia](https://julialang.org/) implementations of algorithms for computational [optimal transport](https://optimaltransport.github.io/), including the Earth-Mover's (Wasserstein) distance, Sinkhorn scaling algorithm for entropy-regularised transport as well as some variants or extensions.
1314

14-
This package provides some implementations of optimal transport algorithms, including the Sinkhorn scaling algorithm and its variants or extensions.
15+
## Overview of supported functionality
1516

16-
## Supported algorithms
17-
18-
* Earth-Mover's distance (`emd`, `emd2`)
19-
* Sinkhorn algorithm (`sinkhorn`, `sinkhorn2`)
17+
* Monge-Kantorovich (Earth-Mover's) distance (`emd`, `emd2`)
18+
* Sinkhorn algorithm for entropy-regularised optimal transport (`sinkhorn`, `sinkhorn2`)
2019
* Log-stabilized Sinkhorn algorithm (`sinkhorn_stabilized`)
2120
* Epsilon-scaling stabilized Sinkhorn algorithm (`sinkhorn_stabilized_epsscaling`)
2221
* Unbalanced Sinkhorn algorithm (`sinkhorn_unbalanced`)
23-
* Sinkhorn barycenter algorithm (`sinkhorn_barycenter`)
24-
* Quadratically regularised optimal transport (`quadreg`)
22+
* Entropy-regularised barycenters (Sinkhorn barycenters) (`sinkhorn_barycenter`)
23+
* Quadratically regularised optimal transport via semismooth Newton scheme [Lorenz, 2019] (`quadreg`)
2524

26-
See the documentation pages for further information. Most calling conventions are analogous to those in the Python Optimal Transport library.
25+
See the documentation pages linked below for further information. Most calling conventions are analogous to those in the [Python Optimal Transport](https://optimaltransport.github.io/) library, which formed the inspiration for this library.
2726

2827
## Documentation
2928

30-
- [Stable](https://zsteve.github.io/OptimalTransport.jl/stable)
31-
- [Dev](https://zsteve.github.io/OptimalTransport.jl/dev)
29+
- [Stable](https://juliaoptimaltransport.github.io/OptimalTransport.jl/stable)
30+
- [Dev](https://juliaoptimaltransport.github.io/OptimalTransport.jl/dev)
3231

33-
## Basic usage and examples
32+
## Contributing
3433

35-
Click [here](http://zsteve.phatcode.net/OptimalTransportDocs/examples/examples.html) for a small collection of optimal transport examples using OptimalTransport.jl.
34+
Contributions are more than welcome! Please feel free to submit an issue or pull request in this repository.
3635

3736
## Acknowledgements
3837

3938
Contributors include:
4039

41-
- Tim Matsumoto
42-
43-
- David Widmann
44-
45-
- Davi Barreira
46-
47-
40+
- Tim Matsumoto (UBC)
41+
- David Widmann (Uppsala)
42+
- Davi Barreira (FGV)
43+
- Stephen Zhang (UBC)
4844

4945
## References
5046

51-
Peyré, G. and Cuturi, M., 2019. Computational optimal transport. Foundations and Trends® in Machine Learning, 11(5-6), pp.355-607.
52-
53-
Lorenz, D.A., Manns, P. and Meyer, C., 2019. Quadratically regularized optimal transport. Applied Mathematics & Optimization, pp.1-31.
54-
55-
Rémi Flamary and Nicolas Courty, POT Python Optimal Transport library, https://pythonot.github.io/, 2017
56-
57-
Chizat, L., Peyré, G., Schmitzer, B. and Vialard, F.X., 2016. Scaling algorithms for unbalanced transport problems. arXiv preprint arXiv:1607.05816.
58-
59-
Schmitzer, B., 2019. Stabilized sparse scaling algorithms for entropy regularized transport problems. SIAM Journal on Scientific Computing, 41(3), pp.A1443-A1481.
47+
- Peyré, G. and Cuturi, M., 2019. Computational optimal transport. Foundations and Trends® in Machine Learning, 11(5-6), pp.355-607.
48+
- Lorenz, D.A., Manns, P. and Meyer, C., 2019. Quadratically regularized optimal transport. Applied Mathematics & Optimization, pp.1-31.
49+
- Rémi Flamary and Nicolas Courty, POT Python Optimal Transport library, https://pythonot.github.io/, 2017
50+
- Chizat, L., Peyré, G., Schmitzer, B. and Vialard, F.X., 2016. Scaling algorithms for unbalanced transport problems. arXiv preprint arXiv:1607.05816.
51+
- Schmitzer, B., 2019. Stabilized sparse scaling algorithms for entropy regularized transport problems. SIAM Journal on Scientific Computing, 41(3), pp.A1443-A1481.

0 commit comments

Comments
 (0)