summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/cache_nbrun1
-rw-r--r--docs/requirements_rtd.txt3
-rw-r--r--docs/source/_templates/module.rst2
-rw-r--r--docs/source/_templates/versions.html69
-rw-r--r--docs/source/all.rst32
-rw-r--r--docs/source/code_of_conduct.rst (renamed from docs/source/.github/CODE_OF_CONDUCT.rst)4
-rw-r--r--docs/source/conf.py7
-rw-r--r--docs/source/contributing.rst (renamed from docs/source/.github/CONTRIBUTING.rst)4
-rw-r--r--docs/source/index.rst4
-rw-r--r--docs/source/quickstart.rst98
10 files changed, 118 insertions, 106 deletions
diff --git a/docs/cache_nbrun b/docs/cache_nbrun
deleted file mode 100644
index ac49515..0000000
--- a/docs/cache_nbrun
+++ /dev/null
@@ -1 +0,0 @@
-{"plot_otda_color_images.ipynb": "128d0435c08ebcf788913e4adcd7dd00", "plot_partial_wass_and_gromov.ipynb": "82242f8390df1d04806b333b745c72cf", "plot_WDA.ipynb": "27f8de4c6d7db46497076523673eedfb", "plot_screenkhorn_1D.ipynb": "af7b8a74a1be0f16f2c3908f5a178de0", "plot_otda_laplacian.ipynb": "d92cc0e528b9277f550daaa6f9d18415", "plot_OT_L1_vs_L2.ipynb": "288230c4e679d752a511353c96c134cb", "plot_otda_semi_supervised.ipynb": "568b39ffbdf6621dd6de162df42f4f21", "plot_fgw.ipynb": "f4de8e6939ce2b1339b3badc1fef0f37", "plot_otda_d2.ipynb": "07ef3212ff3123f16c32a5670e0167f8", "plot_compute_emd.ipynb": "299f6fffcdbf48b7c3268c0136e284f8", "plot_barycenter_fgw.ipynb": "9e813d3b07b7c0c0fcc35a778ca1243f", "plot_convolutional_barycenter.ipynb": "fdd259bfcd6d5fe8001efb4345795d2f", "plot_optim_OTreg.ipynb": "bddd8e49f092873d8980d41ae4974e19", "plot_UOT_1D.ipynb": "2658d5164165941b07539dae3cb80a0f", "plot_OT_1D_smooth.ipynb": "f3e1f0e362c9a78071a40c02b85d2305", "plot_barycenter_1D.ipynb": "f6fa5bc13d9811f09792f73b4de70aa0", "plot_otda_mapping.ipynb": "1bb321763f670fc945d77cfc91471e5e", "plot_OT_1D.ipynb": "0346a8c862606d11f36d0aa087ecab0d", "plot_gromov_barycenter.ipynb": "a7999fcc236d90a0adeb8da2c6370db3", "plot_UOT_barycenter_1D.ipynb": "dd9b857a8c66d71d0124d4a2c30a51dd", "plot_otda_mapping_colors_images.ipynb": "16faae80d6ea8b37d6b1f702149a10de", "plot_stochastic.ipynb": "64f23a8dcbab9823ae92f0fd6c3aceab", "plot_otda_linear_mapping.ipynb": "82417d9141e310bf1f2c2ecdb550094b", "plot_otda_classes.ipynb": "8836a924c9b562ef397af12034fa1abb", "plot_free_support_barycenter.ipynb": "be9d0823f9d7774a289311b9f14548eb", "plot_gromov.ipynb": "de06b1dbe8de99abae51c2e0b64b485d", "plot_otda_jcpot.ipynb": "65482cbfef5c6c1e5e73998aeb5f4b10", "plot_OT_2D_samples.ipynb": "9a9496792fa4216b1059fc70abca851a", "plot_barycenter_lp_vs_entropic.ipynb": "334840b69a86898813e50a6db0f3d0de"} \ No newline at end of file
diff --git a/docs/requirements_rtd.txt b/docs/requirements_rtd.txt
index 11957fb..30082bb 100644
--- a/docs/requirements_rtd.txt
+++ b/docs/requirements_rtd.txt
@@ -9,7 +9,6 @@ scipy>=1.0
cython
matplotlib
autograd
-pymanopt==0.2.4; python_version <'3'
-pymanopt; python_version >= '3'
+pymanopt
cvxopt
scikit-learn \ No newline at end of file
diff --git a/docs/source/_templates/module.rst b/docs/source/_templates/module.rst
index 5ad89be..495995e 100644
--- a/docs/source/_templates/module.rst
+++ b/docs/source/_templates/module.rst
@@ -2,6 +2,7 @@
{{ underline }}
.. automodule:: {{ fullname }}
+ :members:
{% block functions %}
{% if functions %}
@@ -12,6 +13,7 @@
{% for item in functions %}
.. autofunction:: {{ item }}
+
.. include:: backreferences/{{fullname}}.{{item}}.examples
diff --git a/docs/source/_templates/versions.html b/docs/source/_templates/versions.html
index f48ab86..5b1021a 100644
--- a/docs/source/_templates/versions.html
+++ b/docs/source/_templates/versions.html
@@ -1,47 +1,50 @@
<div class="rst-versions" data-toggle="rst-versions" role="note"
aria-label="versions">
- <!-- add shift_up to the class for force viewing -->
- <span class="rst-current-version" data-toggle="rst-current-version">
+ <!-- add shift_up to the class for force viewing ,
+ data-toggle="rst-current-version" -->
+ <span class="rst-current-version" style="margin-bottom:1mm;">
<span class="fa fa-book"> Python Optimal Transport</span>
- versions
- <span class="fa fa-caret-down"></span>
+ <hr style="margin-bottom:1.5mm;margin-top:5mm;">
+ <!-- versions
+ <span class="fa fa-caret-down"></span>-->
+ <span class="rst-current-version" style="display: inline-block;padding:
+ 0px;color:#fcfcfcab;float:left;font-size: 100%;">
+ Versions:
+ <a href="https://pythonot.github.io/"
+ style="padding: 3px;color:#fcfcfc;font-size: 100%;">Release</a>
+ <a href="https://pythonot.github.io/master"
+ style="padding: 3px;color:#fcfcfc;font-size: 100%;">Development</a>
+ <a href="https://github.com/PythonOT/POT"
+ style="padding: 3px;color:#fcfcfc;font-size: 100%;">Code</a>
+
+ </span>
+
+
</span>
- <div class="rst-other-versions"><!-- Inserted RTD Footer -->
+
+ <!--
+ <div class="rst-other-versions">
+
+
<div class="injected">
-
-
- <dl>
- <dt>Versions</dt>
-
- <dd><a href="https://pythonot.github.io/">Release</a></dd>
-
- <dd><a href="https://pythonot.github.io/master">Development</a></dd>
-
-
-
- </dl>
-
+
+ <dl>
+ <dt>Versions</dt>
+ <dd><a href="https://pythonot.github.io/">Release</a></dd>
-
- <dl>
- <dt>On GitHub</dt>
- <dd>
- <a href="https://github.com/PythonOT/POT">Code on Github</a>
- </dd>
-
- </dl>
-
+ <dd><a href="https://pythonot.github.io/master">Development</a></dd>
+
-
-
- <hr>
-
+ <dt><a href="https://github.com/PythonOT/POT">Code on Github</a></dt>
+
+ </dl>
+ <hr>
-</div>
-</div>
+</div>
+</div>-->
</div> \ No newline at end of file
diff --git a/docs/source/all.rst b/docs/source/all.rst
index 1ec6be3..a9d7fe2 100644
--- a/docs/source/all.rst
+++ b/docs/source/all.rst
@@ -13,28 +13,34 @@ API and modules
:toctree: gen_modules/
:template: module.rst
- lp
+
backend
bregman
- smooth
- gromov
- optim
+ coot
da
- dr
- utils
datasets
+ dr
+ factored
+ gaussian
+ gromov
+ lp
+ optim
+ partial
plot
- stochastic
- unbalanced
regpath
- partial
sliced
+ smooth
+ stochastic
+ unbalanced
+ utils
weak
- factored
+
-.. autosummary::
- :toctree: ../modules/generated/
- :template: module.rst
+Main :py:mod:`ot` functions
+---------------------------
.. automodule:: ot
:members:
+
+
+
diff --git a/docs/source/.github/CODE_OF_CONDUCT.rst b/docs/source/code_of_conduct.rst
index d4c5cec..40b432e 100644
--- a/docs/source/.github/CODE_OF_CONDUCT.rst
+++ b/docs/source/code_of_conduct.rst
@@ -1,6 +1,6 @@
-Code of Conduct
+Code of conduct
===============
-.. include:: ../../../.github/CODE_OF_CONDUCT.md
+.. include:: ../../.github/CODE_OF_CONDUCT.md
:parser: myst_parser.sphinx_
:start-line: 2
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 9526518..6e76291 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -119,7 +119,7 @@ release = __version__
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
-language = None
+language = "en"
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
@@ -194,6 +194,7 @@ html_logo = '_static/images/logo_dark.svg'
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
+#html_css_files = ["css/custom.css"]
# Add any extra paths that contain custom files (such as robots.txt or
@@ -340,6 +341,9 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
+autodoc_default_options = {'autosummary': True,
+ 'autosummary_imported_members': True}
+
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
@@ -351,6 +355,7 @@ intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
sphinx_gallery_conf = {
'examples_dirs': ['../../examples', '../../examples/da'],
'gallery_dirs': 'auto_examples',
+ 'nested_sections' : False,
'backreferences_dir': 'gen_modules/backreferences',
'inspect_global_variables' : True,
'doc_module' : ('ot','numpy','scipy','pylab'),
diff --git a/docs/source/.github/CONTRIBUTING.rst b/docs/source/contributing.rst
index aef24e9..8dec19a 100644
--- a/docs/source/.github/CONTRIBUTING.rst
+++ b/docs/source/contributing.rst
@@ -1,6 +1,6 @@
Contributing to POT
===================
-.. include:: ../../../.github/CONTRIBUTING.md
+.. include:: ../../.github/CONTRIBUTING.md
:parser: myst_parser.sphinx_
- :start-line: 3
+ :start-line: 2
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 3d53ef4..0f04738 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -21,9 +21,9 @@ Contents
all
auto_examples/index
releases
- .github/CONTRIBUTING
contributors
- .github/CODE_OF_CONDUCT
+ contributing
+ code_of_conduct
.. include:: ../../README.md
diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst
index b4cc8ab..1dc9f71 100644
--- a/docs/source/quickstart.rst
+++ b/docs/source/quickstart.rst
@@ -127,14 +127,6 @@ been used to solve both graph Laplacian regularization OT and Gromov
Wasserstein [30]_.
-.. note::
-
- POT is originally designed to solve OT problems with Numpy interface and
- is not yet compatible with Pytorch API. We are currently working on a torch
- submodule that will provide OT solvers and losses for the most common deep
- learning configurations.
-
-
When not to use POT
"""""""""""""""""""
@@ -279,7 +271,7 @@ distributions. In this case there exists a close form solution given in Remark
2.29 in [15]_ and the Monge mapping is an affine function and can be
also computed from the covariances and means of the source and target
distributions. In the case when the finite sample dataset is supposed Gaussian,
-we provide :any:`ot.da.OT_mapping_linear` that returns the parameters for the
+we provide :any:`ot.gaussian.bures_wasserstein_mapping` that returns the parameters for the
Monge mapping.
@@ -628,7 +620,7 @@ approximate a Monge mapping from finite distributions.
First note that when the source and target distributions are supposed to be Gaussian
distributions, there exists a close form solution for the mapping and its an
affine function [14]_ of the form :math:`T(x)=Ax+b` . In this case we provide the function
-:any:`ot.da.OT_mapping_linear` that returns the operator :math:`A` and vector
+:any:`ot.gaussian.bures_wasserstein_mapping` that returns the operator :math:`A` and vector
:math:`b`. Note that if the number of samples is too small there is a parameter
:code:`reg` that provides a regularization for the covariance matrix estimation.
@@ -640,7 +632,7 @@ method proposed in [8]_ that estimates a continuous mapping approximating the
barycentric mapping is provided in :any:`ot.da.joint_OT_mapping_linear` for
linear mapping and :any:`ot.da.joint_OT_mapping_kernel` for non-linear mapping.
-.. minigallery:: ot.da.joint_OT_mapping_linear ot.da.joint_OT_mapping_linear ot.da.OT_mapping_linear
+.. minigallery:: ot.da.joint_OT_mapping_linear ot.da.joint_OT_mapping_linear ot.gaussian.bures_wasserstein_mapping
:add-heading: Examples of Monge mapping estimation
:heading-level: "
@@ -692,42 +684,8 @@ A list of the provided implementation is given in the following note.
:heading-level: "
-Other applications
-------------------
-
-We discuss in the following several OT related problems and tools that has been
-proposed in the OT and machine learning community.
-
-Wasserstein Discriminant Analysis
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Wasserstein Discriminant Analysis [11]_ is a generalization of `Fisher Linear Discriminant
-Analysis <https://en.wikipedia.org/wiki/Linear_discriminant_analysis>`__ that
-allows discrimination between classes that are not linearly separable. It
-consists in finding a linear projector optimizing the following criterion
-
-.. math::
- P = \text{arg}\min_P \frac{\sum_i OT_e(\mu_i\#P,\mu_i\#P)}{\sum_{i,j\neq i}
- OT_e(\mu_i\#P,\mu_j\#P)}
-
-where :math:`\#` is the push-forward operator, :math:`OT_e` is the entropic OT
-loss and :math:`\mu_i` is the
-distribution of samples from class :math:`i`. :math:`P` is also constrained to
-be in the Stiefel manifold. WDA can be solved in POT using function
-:any:`ot.dr.wda`. It requires to have installed :code:`pymanopt` and
-:code:`autograd` for manifold optimization and automatic differentiation
-respectively. Note that we also provide the Fisher discriminant estimator in
-:any:`ot.dr.fda` for easy comparison.
-
-.. warning::
-
- Note that due to the hard dependency on :code:`pymanopt` and
- :code:`autograd`, :any:`ot.dr` is not imported by default. If you want to
- use it you have to specifically import it with :code:`import ot.dr` .
-
-.. minigallery:: ot.dr.wda
- :add-heading: Examples of the use of WDA
- :heading-level: "
+Unbalanced and partial OT
+-------------------------
@@ -845,10 +803,11 @@ regularization of the problem.
:heading-level: "
+Gromov Wasserstein and extensions
+---------------------------------
-
-Gromov-Wasserstein
-^^^^^^^^^^^^^^^^^^
+Gromov Wasserstein(GW)
+^^^^^^^^^^^^^^^^^^^^^^
Gromov Wasserstein (GW) is a generalization of OT to distributions that do not lie in
the same space [13]_. In this case one cannot compute distance between samples
@@ -877,6 +836,8 @@ There also exists an entropic regularized variant of GW that has been proposed i
:add-heading: Examples of computation of GW, regularized G and FGW
:heading-level: "
+Gromov Wasserstein barycenters
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note that similarly to Wasserstein distance GW allows for the definition of GW
barycenters that can be expressed as
@@ -905,6 +866,43 @@ The implementations of FGW and FGW barycenter is provided in functions
:heading-level: "
+Other applications
+------------------
+
+We discuss in the following several OT related problems and tools that has been
+proposed in the OT and machine learning community.
+
+Wasserstein Discriminant Analysis
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Wasserstein Discriminant Analysis [11]_ is a generalization of `Fisher Linear Discriminant
+Analysis <https://en.wikipedia.org/wiki/Linear_discriminant_analysis>`__ that
+allows discrimination between classes that are not linearly separable. It
+consists in finding a linear projector optimizing the following criterion
+
+.. math::
+ P = \text{arg}\min_P \frac{\sum_i OT_e(\mu_i\#P,\mu_i\#P)}{\sum_{i,j\neq i}
+ OT_e(\mu_i\#P,\mu_j\#P)}
+
+where :math:`\#` is the push-forward operator, :math:`OT_e` is the entropic OT
+loss and :math:`\mu_i` is the
+distribution of samples from class :math:`i`. :math:`P` is also constrained to
+be in the Stiefel manifold. WDA can be solved in POT using function
+:any:`ot.dr.wda`. It requires to have installed :code:`pymanopt` and
+:code:`autograd` for manifold optimization and automatic differentiation
+respectively. Note that we also provide the Fisher discriminant estimator in
+:any:`ot.dr.fda` for easy comparison.
+
+.. warning::
+
+ Note that due to the hard dependency on :code:`pymanopt` and
+ :code:`autograd`, :any:`ot.dr` is not imported by default. If you want to
+ use it you have to specifically import it with :code:`import ot.dr` .
+
+.. minigallery:: ot.dr.wda
+ :add-heading: Examples of the use of WDA
+ :heading-level: "
+
Solving OT with Multiple backends on CPU/GPU
--------------------------------------------