From 84c57df0169b6bb7a1cbe145f3bfa1b7010aa4b9 Mon Sep 17 00:00:00 2001 From: Oleksii Kachaiev Date: Wed, 3 May 2023 14:14:47 +0200 Subject: [PATCH 1/7] Fix ref to JAX --- docs/source/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index b7a9e3598..48298ee19 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -351,7 +351,8 @@ def __getattr__(cls, name): 'numpy': ('http://docs.scipy.org/doc/numpy/', None), 'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None), 'matplotlib': ('http://matplotlib.org/', None), - 'torch': ('https://pytorch.org/docs/stable/', None)} + 'torch': ('https://pytorch.org/docs/stable/', None), + 'jax': ('https://jax.readthedocs.io/en/latest/', None)} sphinx_gallery_conf = { 'examples_dirs': ['../../examples', '../../examples/da'], From 5fdff472693c8190c81843183973a2fbd3d57a19 Mon Sep 17 00:00:00 2001 From: Oleksii Kachaiev Date: Thu, 4 May 2023 13:44:41 +0200 Subject: [PATCH 2/7] Fix references to numpy.random.* --- docs/source/conf.py | 2 +- ot/backend.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 48298ee19..e88804bd6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -348,7 +348,7 @@ def __getattr__(cls, name): # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'python': ('https://docs.python.org/3', None), - 'numpy': ('http://docs.scipy.org/doc/numpy/', None), + 'numpy': ('https://numpy.org/doc/stable/', None), 'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None), 'matplotlib': ('http://matplotlib.org/', None), 'torch': ('https://pytorch.org/docs/stable/', None), diff --git a/ot/backend.py b/ot/backend.py index a82c4486a..f527543cb 100644 --- a/ot/backend.py +++ b/ot/backend.py @@ -670,7 +670,7 @@ def seed(self, seed=None): This function follows the api from :any:`numpy.random.seed` - See: https://numpy.org/doc/stable/reference/generated/numpy.random.seed.html + See: https://numpy.org/doc/stable/reference/random/generated/numpy.random.seed.html """ raise NotImplementedError() @@ -680,7 +680,7 @@ def rand(self, *size, type_as=None): This function follows the api from :any:`numpy.random.rand` - See: https://numpy.org/doc/stable/reference/generated/numpy.random.rand.html + See: https://numpy.org/doc/stable/reference/random/generated/numpy.random.rand.html """ raise NotImplementedError() @@ -690,7 +690,7 @@ def randn(self, *size, type_as=None): This function follows the api from :any:`numpy.random.rand` - See: https://numpy.org/doc/stable/reference/generated/numpy.random.rand.html + See: https://numpy.org/doc/stable/reference/random/generated/numpy.random.rand.html """ raise NotImplementedError() From f88af748ebab98f8daede63b9718c7ae9e5ff4b4 Mon Sep 17 00:00:00 2001 From: Oleksii Kachaiev Date: Fri, 5 May 2023 23:12:39 +0200 Subject: [PATCH 3/7] Typo in CONTRIBUTING --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 168ffb34c..c66ab3e61 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -199,4 +199,4 @@ method does to the data and a figure (coming from an example) illustrating it. -This Contribution guide is strongly inpired by the one of the [scikit-learn](https://github.com/scikit-learn/scikit-learn) team. +This Contribution guide is strongly inspired by the one of the [scikit-learn](https://github.com/scikit-learn/scikit-learn) team. From ca05461257f613396e2adee91afcfbe775d208be Mon Sep 17 00:00:00 2001 From: Oleksii Kachaiev Date: Fri, 5 May 2023 23:28:26 +0200 Subject: [PATCH 4/7] Removed :any: reference from func parameters --- ot/solvers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ot/solvers.py b/ot/solvers.py index 0294d714c..aa57a4bff 100644 --- a/ot/solvers.py +++ b/ot/solvers.py @@ -28,10 +28,10 @@ def solve(M, a=None, b=None, reg=None, reg_type="KL", unbalanced=None, \lambda_u U(\mathbf{T}\mathbf{1},\mathbf{a}) + \lambda_u U(\mathbf{T}^T\mathbf{1},\mathbf{b}) - The regularization is selected with :any:`reg` (:math:`\lambda_r`) and :any:`reg_type`. By + The regularization is selected with ``reg`` (:math:`\lambda_r`) and ``reg_type``. By default ``reg=None`` and there is no regularization. The unbalanced marginal - penalization can be selected with :any:`unbalanced` (:math:`\lambda_u`) and - :any:`unbalanced_type`. By default ``unbalanced=None`` and the function + penalization can be selected with ``unbalanced`` (:math:`\lambda_u`) and + ``unbalanced_type``. By default ``unbalanced=None`` and the function solves the exact optimal transport problem (respecting the marginals). Parameters From 7a8ead2914b3132635e6375d36869e088caba25a Mon Sep 17 00:00:00 2001 From: Oleksii Kachaiev Date: Fri, 5 May 2023 23:55:35 +0200 Subject: [PATCH 5/7] Make markup of params consistent with other docstrings --- ot/solvers.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ot/solvers.py b/ot/solvers.py index aa57a4bff..bba2734e5 100644 --- a/ot/solvers.py +++ b/ot/solvers.py @@ -28,10 +28,10 @@ def solve(M, a=None, b=None, reg=None, reg_type="KL", unbalanced=None, \lambda_u U(\mathbf{T}\mathbf{1},\mathbf{a}) + \lambda_u U(\mathbf{T}^T\mathbf{1},\mathbf{b}) - The regularization is selected with ``reg`` (:math:`\lambda_r`) and ``reg_type``. By + The regularization is selected with `reg` (:math:`\lambda_r`) and `reg_type`. By default ``reg=None`` and there is no regularization. The unbalanced marginal - penalization can be selected with ``unbalanced`` (:math:`\lambda_u`) and - ``unbalanced_type``. By default ``unbalanced=None`` and the function + penalization can be selected with `unbalanced` (:math:`\lambda_u`) and + `unbalanced_type`. By default ``unbalanced=None`` and the function solves the exact optimal transport problem (respecting the marginals). Parameters @@ -46,12 +46,12 @@ def solve(M, a=None, b=None, reg=None, reg_type="KL", unbalanced=None, Regularization weight :math:`\lambda_r`, by default None (no reg., exact OT) reg_type : str, optional - Type of regularization :math:`R` either "KL", "L2", 'entropy', by default "KL" + Type of regularization :math:`R` either "KL", "L2", "entropy", by default "KL" unbalanced : float, optional Unbalanced penalization weight :math:`\lambda_u`, by default None (balanced OT) unbalanced_type : str, optional - Type of unbalanced penalization unction :math:`U` either "KL", "L2", 'TV', by default 'KL' + Type of unbalanced penalization unction :math:`U` either "KL", "L2", "TV", by default "KL" n_threads : int, optional Number of OMP threads for exact OT solver, by default 1 max_iter : int, optional From fa6e8f1b2dd2379bcb809a31622419ee1a4f634e Mon Sep 17 00:00:00 2001 From: Oleksii Kachaiev Date: Sat, 6 May 2023 20:06:57 +0200 Subject: [PATCH 6/7] Mentioned latest open PR in RELEASES --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 02fddad91..cdb9b2167 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -11,7 +11,7 @@ - Fix circleci-redirector action and codecov (PR #460) - Fix issues with cuda for ot.binary_search_circle and with gradients for ot.sliced_wasserstein_sphere (PR #457) -- Major documentation cleanup (PR #462, #467) +- Major documentation cleanup (PR #462, #467, #475) - Fix gradients for "Wasserstein2 Minibatch GAN" example (PR #466) - Faster Bures-Wasserstein distance with NumPy backend (PR #468) - Fix issue backend for ot.sliced_wasserstein_sphere ot.sliced_wasserstein_sphere_unif (PR #471) From 839d4fed863d2f03f794e17131fb3fe91999bc8a Mon Sep 17 00:00:00 2001 From: Oleksii Kachaiev Date: Sun, 7 May 2023 13:31:37 +0200 Subject: [PATCH 7/7] Fix See Also references for ot.factored --- ot/factored.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ot/factored.py b/ot/factored.py index abc244545..8d6615876 100644 --- a/ot/factored.py +++ b/ot/factored.py @@ -81,8 +81,8 @@ def factored_optimal_transport(Xa, Xb, a=None, b=None, reg=0.0, r=100, X0=None, See Also -------- - ot.bregman.sinkhorn : Entropic regularized OT ot.optim.cg : General - regularized OT + ot.bregman.sinkhorn : Entropic regularized OT + ot.optim.cg : General regularized OT """ nx = get_backend(Xa, Xb)