From adf9d046445bf142a29d914352f397b36f7905c0 Mon Sep 17 00:00:00 2001 From: Hicham Janati Date: Tue, 18 Jun 2019 22:26:48 +0200 Subject: update Readme + minor rendering in examples --- README.md | 4 ++++ examples/plot_UOT_1D.py | 8 ++++---- examples/plot_UOT_barycenter_1D.py | 10 +++++----- ot/unbalanced.py | 6 +++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b6b215c..d24d8b9 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ It provides the following solvers: * Gromov-Wasserstein distances and barycenters ([13] and regularized [12]) * Stochastic Optimization for Large-scale Optimal Transport (semi-dual problem [18] and dual problem [19]) * Non regularized free support Wasserstein barycenters [20]. +* Unbalanced OT with KL relaxation distance and barycenter [10, 25]. Some demonstrations (both in Python and Jupyter Notebook format) are available in the examples folder. @@ -165,6 +166,7 @@ The contributors to this library are: * [Kilian Fatras](https://kilianfatras.github.io/) * [Alain Rakotomamonjy](https://sites.google.com/site/alainrakotomamonjy/home) * [Vayer Titouan](https://tvayer.github.io/) +* [Hicham Janati](https://hichamjanati.github.io/) (Unbalanced OT) This toolbox benefit a lot from open source research and we would like to thank the following persons for providing some code (in various languages): @@ -236,3 +238,5 @@ You can also post bug reports and feature requests in Github issues. Make sure t [23] Aude, G., Peyré, G., Cuturi, M., [Learning Generative Models with Sinkhorn Divergences](https://arxiv.org/abs/1706.00292), Proceedings of the Twenty-First International Conference on Artficial Intelligence and Statistics, (AISTATS) 21, 2018 [24] Vayer, T., Chapel, L., Flamary, R., Tavenard, R. and Courty, N. (2019). [Optimal Transport for structured data with application on graphs](http://proceedings.mlr.press/v97/titouan19a.html) Proceedings of the 36th International Conference on Machine Learning (ICML). + +[25] Frogner C., Zhang C., Mobahi H., Araya-Polo M., Poggio T. (2019). [Learning with a Wasserstein Loss](http://cbcl.mit.edu/wasserstein/) Advances in Neural Information Processing Systems (NIPS). diff --git a/examples/plot_UOT_1D.py b/examples/plot_UOT_1D.py index 59b7e77..2ea8b05 100644 --- a/examples/plot_UOT_1D.py +++ b/examples/plot_UOT_1D.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- """ -==================== +=============================== 1D Unbalanced optimal transport -==================== +=============================== This example illustrates the computation of Unbalanced Optimal transport using a Kullback-Leibler relaxation. @@ -53,7 +53,7 @@ pl.plot(x, a, 'b', label='Source distribution') pl.plot(x, b, 'r', label='Target distribution') pl.legend() -#%% plot distributions and loss matrix +# plot distributions and loss matrix pl.figure(2, figsize=(5, 5)) ot.plot.plot1D_mat(a, b, M, 'Cost matrix M') @@ -64,7 +64,7 @@ ot.plot.plot1D_mat(a, b, M, 'Cost matrix M') # -------------- -#%% Sinkhorn +# Sinkhorn epsilon = 0.1 # entropy parameter alpha = 1. # Unbalanced KL relaxation parameter diff --git a/examples/plot_UOT_barycenter_1D.py b/examples/plot_UOT_barycenter_1D.py index 8dfb84f..c8d9d3b 100644 --- a/examples/plot_UOT_barycenter_1D.py +++ b/examples/plot_UOT_barycenter_1D.py @@ -27,7 +27,7 @@ from matplotlib.collections import PolyCollection # Generate data # ------------- -#%% parameters +# parameters n = 100 # nb bins @@ -53,7 +53,7 @@ M /= M.max() # Plot data # --------- -#%% plot the distributions +# plot the distributions pl.figure(1, figsize=(6.4, 3)) for i in range(n_distributions): @@ -65,7 +65,7 @@ pl.tight_layout() # Barycenter computation # ---------------------- -#%% non weighted barycenter computation +# non weighted barycenter computation weight = 0.5 # 0<=weight<=1 weights = np.array([1 - weight, weight]) @@ -97,7 +97,7 @@ pl.tight_layout() # Barycentric interpolation # ------------------------- -#%% barycenter interpolation +# barycenter interpolation n_weight = 11 weight_list = np.linspace(0, 1, n_weight) @@ -114,7 +114,7 @@ for i in range(0, n_weight): B_wass[:, i] = ot.unbalanced.barycenter_unbalanced(A, M, reg, alpha, weights) -#%% plot interpolation +# plot interpolation pl.figure(3) diff --git a/ot/unbalanced.py b/ot/unbalanced.py index 97e2576..918dda4 100644 --- a/ot/unbalanced.py +++ b/ot/unbalanced.py @@ -87,7 +87,7 @@ def sinkhorn_unbalanced(a, b, M, reg, alpha, method='sinkhorn', numItermax=1000, .. [10] Chizat, L., Peyré, G., Schmitzer, B., & Vialard, F. X. (2016). Scaling algorithms for unbalanced transport problems. arXiv preprint arXiv:1607.05816. - .. [23] Frogner C., Zhang C., Mobahi H., Araya-Polo M., Poggio T. : Learning with a Wasserstein Loss, Advances in Neural Information Processing Systems (NIPS) 2015 + .. [25] Frogner C., Zhang C., Mobahi H., Araya-Polo M., Poggio T. : Learning with a Wasserstein Loss, Advances in Neural Information Processing Systems (NIPS) 2015 See Also @@ -196,7 +196,7 @@ def sinkhorn_unbalanced2(a, b, M, reg, alpha, method='sinkhorn', .. [10] Chizat, L., Peyré, G., Schmitzer, B., & Vialard, F. X. (2016). Scaling algorithms for unbalanced transport problems. arXiv preprint arXiv:1607.05816. - .. [23] Frogner C., Zhang C., Mobahi H., Araya-Polo M., Poggio T. : Learning with a Wasserstein Loss, Advances in Neural Information Processing Systems (NIPS) 2015 + .. [25] Frogner C., Zhang C., Mobahi H., Araya-Polo M., Poggio T. : Learning with a Wasserstein Loss, Advances in Neural Information Processing Systems (NIPS) 2015 See Also -------- @@ -299,7 +299,7 @@ def sinkhorn_knopp_unbalanced(a, b, M, reg, alpha, numItermax=1000, .. [10] Chizat, L., Peyré, G., Schmitzer, B., & Vialard, F. X. (2016). Scaling algorithms for unbalanced transport problems. arXiv preprint arXiv:1607.05816. - .. [23] Frogner C., Zhang C., Mobahi H., Araya-Polo M., Poggio T. : Learning with a Wasserstein Loss, Advances in Neural Information Processing Systems (NIPS) 2015 + .. [25] Frogner C., Zhang C., Mobahi H., Araya-Polo M., Poggio T. : Learning with a Wasserstein Loss, Advances in Neural Information Processing Systems (NIPS) 2015 See Also -------- -- cgit v1.2.3