diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2019-07-03 14:11:16 +0200 |
---|---|---|
committer | Rémi Flamary <remi.flamary@gmail.com> | 2019-07-03 14:11:16 +0200 |
commit | 7402d344240ce94e33c53daff419d4356278d48f (patch) | |
tree | c5b1b8f10eaee4c2ecaa12f629255489c2481590 /ot | |
parent | d3236cf0cab000b5604f8ede9ebcbdc19d8c213f (diff) |
doc in modules
Diffstat (limited to 'ot')
-rw-r--r-- | ot/__init__.py | 29 | ||||
-rw-r--r-- | ot/dr.py | 6 | ||||
-rw-r--r-- | ot/gpu/__init__.py | 4 | ||||
-rw-r--r-- | ot/lp/__init__.py | 5 | ||||
-rw-r--r-- | ot/plot.py | 6 | ||||
-rw-r--r-- | ot/stochastic.py | 6 | ||||
-rw-r--r-- | ot/utils.py | 2 |
7 files changed, 51 insertions, 7 deletions
diff --git a/ot/__init__.py b/ot/__init__.py index 35d2ddd..35ae6fc 100644 --- a/ot/__init__.py +++ b/ot/__init__.py @@ -1,7 +1,33 @@ """ This is the main module of the POT toolbox. It provides easy access to -a number of functions described below. +a number of sub-modules and functions described below. + +.. note:: + + + Here is a list of the submodules and short description of what they contain. + + - :any:`ot.lp` contains OT solvers for the exact (Linear Program) OT problems. + - :any:`ot.bregman` contains OT solvers for the entropic OT problems using + Bregman projections. + - :any:`ot.lp` contains OT solvers for the exact (Linear Program) OT problems. + - :any:`ot.smooth` contains OT solvers for the regularized (l2 and kl) smooth OT + problems. + - :any:`ot.gromov` contains solvers for Gromov-Wasserstein and Fused Gromov + Wasserstein problems. + - :any:`ot.optim` contains generic solvers OT based optimization problems + - :any:`ot.da` contains classes and function related to Monge mapping + estimation and Domain Adaptation (DA). + - :any:`ot.gpu` contains GPU (cupy) implementation of some OT solvers + - :any:`ot.dr` contains Dimension Reduction (DR) methods such as Wasserstein + Discriminant Analysis. + - :any:`ot.utils` contains utility functions such as distance computation and + timing. + - :any:`ot.datasets` contains toy dataset generation functions. + - :any:`ot.plot` contains visualization functions + - :any:`ot.stochastic` contains stochastic solvers for regularized OT. + - :any:`ot.unbalanced` contains solvers for regularized unbalanced OT. .. warning:: The list of automatically imported sub-modules is as follows: @@ -14,6 +40,7 @@ a number of functions described below. - :any:`ot.dr` : depends on :code:`pymanopt` and :code:`autograd`. - :any:`ot.gpu` : depends on :code:`cupy` and a CUDA GPU. + - :any:`ot.plot` : depends on :code:`matplotlib` """ @@ -1,6 +1,12 @@ # -*- coding: utf-8 -*- """ Dimension reduction with optimal transport + + +.. warning:: + Note that by default the module is not import in :mod:`ot`. In order to + use it you need to explicitely import :mod:`ot.dr` + """ # Author: Remi Flamary <remi.flamary@unice.fr> diff --git a/ot/gpu/__init__.py b/ot/gpu/__init__.py index 6a2afcf..1ab95bb 100644 --- a/ot/gpu/__init__.py +++ b/ot/gpu/__init__.py @@ -6,8 +6,8 @@ functions. The GPU backend in handled by `cupy <https://cupy.chainer.org/>`_. .. warning:: - Note that by default the module is not import in :mod:`ot`. in order to - use it you need to import :mod:`ot.gpu` . + Note that by default the module is not import in :mod:`ot`. In order to + use it you need to explicitely import :mod:`ot.gpu` . By default, the functions in this module accept and return numpy arrays in order to proide drop-in replacement for the other POT function but diff --git a/ot/lp/__init__.py b/ot/lp/__init__.py index aed29f8..17f1731 100644 --- a/ot/lp/__init__.py +++ b/ot/lp/__init__.py @@ -544,14 +544,13 @@ def wasserstein_1d(x_a, x_b, a=None, b=None, p=1.): r"""Solves the p-Wasserstein distance problem between 1d measures and returns the distance - .. math:: - \gamma = arg\min_\gamma \left( \sum_i \sum_j \gamma_{ij} - |x_a[i] - x_b[j]|^p \\right)^{1/p} + \min_\gamma \left( \sum_i \sum_j \gamma_{ij} \|x_a[i] - x_b[j]\|^p \right)^{1/p} s.t. \gamma 1 = a, \gamma^T 1= b, \gamma\geq 0 + where : - x_a and x_b are the samples @@ -1,5 +1,11 @@ """ Functions for plotting OT matrices + +.. warning:: + Note that by default the module is not import in :mod:`ot`. In order to + use it you need to explicitely import :mod:`ot.plot` + + """ # Author: Remi Flamary <remi.flamary@unice.fr> diff --git a/ot/stochastic.py b/ot/stochastic.py index bf3e7a7..5754968 100644 --- a/ot/stochastic.py +++ b/ot/stochastic.py @@ -1,3 +1,9 @@ +""" +Stochastic solvers for regularized OT. + + +""" + # Author: Kilian Fatras <kilian.fatras@gmail.com> # # License: MIT License diff --git a/ot/utils.py b/ot/utils.py index f21ceb9..e8249ef 100644 --- a/ot/utils.py +++ b/ot/utils.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- """ -Various function that can be usefull +Various useful functions """ # Author: Remi Flamary <remi.flamary@unice.fr> |