summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksii Kachaiev <kachayev@gmail.com>2023-05-11 08:23:06 +0200
committerGitHub <noreply@github.com>2023-05-11 08:23:06 +0200
commit5faa4fbdb1a64351a42d31dd6f54f0402c29c405 (patch)
treead851bc53df627418d843d36168657a77852b97a
parent8cc8dd2e8e13022b03bcd013becc08e7e18c404a (diff)
[DOC] Fix references to JAX and numpy functions (#475)
* Fix ref to JAX * Fix references to numpy.random.* * Typo in CONTRIBUTING * Removed :any: reference from func parameters * Make markup of params consistent with other docstrings * Mentioned latest open PR in RELEASES * Fix See Also references for ot.factored --------- Co-authored-by: RĂ©mi Flamary <remi.flamary@gmail.com>
-rw-r--r--.github/CONTRIBUTING.md2
-rw-r--r--RELEASES.md2
-rw-r--r--docs/source/conf.py5
-rw-r--r--ot/backend.py6
-rw-r--r--ot/factored.py4
-rw-r--r--ot/solvers.py10
6 files changed, 15 insertions, 14 deletions
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 168ffb3..c66ab3e 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.
diff --git a/RELEASES.md b/RELEASES.md
index 0870b34..5c50423 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -12,7 +12,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)
diff --git a/docs/source/conf.py b/docs/source/conf.py
index b7a9e35..e88804b 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -348,10 +348,11 @@ autodoc_default_options = {'autosummary': True,
# 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)}
+ 'torch': ('https://pytorch.org/docs/stable/', None),
+ 'jax': ('https://jax.readthedocs.io/en/latest/', None)}
sphinx_gallery_conf = {
'examples_dirs': ['../../examples', '../../examples/da'],
diff --git a/ot/backend.py b/ot/backend.py
index 9aa14e6..33c323d 100644
--- a/ot/backend.py
+++ b/ot/backend.py
@@ -680,7 +680,7 @@ class Backend():
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()
@@ -690,7 +690,7 @@ class Backend():
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()
@@ -700,7 +700,7 @@ class Backend():
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()
diff --git a/ot/factored.py b/ot/factored.py
index abc2445..8d66158 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)
diff --git a/ot/solvers.py b/ot/solvers.py
index 0294d71..bba2734 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
@@ -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