Skip to content

Commit 7402d34

Browse files
committed
doc in modules
1 parent d3236cf commit 7402d34

File tree

7 files changed

+51
-7
lines changed

7 files changed

+51
-7
lines changed

ot/__init__.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,33 @@
11
"""
22
33
This is the main module of the POT toolbox. It provides easy access to
4-
a number of functions described below.
4+
a number of sub-modules and functions described below.
5+
6+
.. note::
7+
8+
9+
Here is a list of the submodules and short description of what they contain.
10+
11+
- :any:`ot.lp` contains OT solvers for the exact (Linear Program) OT problems.
12+
- :any:`ot.bregman` contains OT solvers for the entropic OT problems using
13+
Bregman projections.
14+
- :any:`ot.lp` contains OT solvers for the exact (Linear Program) OT problems.
15+
- :any:`ot.smooth` contains OT solvers for the regularized (l2 and kl) smooth OT
16+
problems.
17+
- :any:`ot.gromov` contains solvers for Gromov-Wasserstein and Fused Gromov
18+
Wasserstein problems.
19+
- :any:`ot.optim` contains generic solvers OT based optimization problems
20+
- :any:`ot.da` contains classes and function related to Monge mapping
21+
estimation and Domain Adaptation (DA).
22+
- :any:`ot.gpu` contains GPU (cupy) implementation of some OT solvers
23+
- :any:`ot.dr` contains Dimension Reduction (DR) methods such as Wasserstein
24+
Discriminant Analysis.
25+
- :any:`ot.utils` contains utility functions such as distance computation and
26+
timing.
27+
- :any:`ot.datasets` contains toy dataset generation functions.
28+
- :any:`ot.plot` contains visualization functions
29+
- :any:`ot.stochastic` contains stochastic solvers for regularized OT.
30+
- :any:`ot.unbalanced` contains solvers for regularized unbalanced OT.
531
632
.. warning::
733
The list of automatically imported sub-modules is as follows:
@@ -14,6 +40,7 @@
1440
1541
- :any:`ot.dr` : depends on :code:`pymanopt` and :code:`autograd`.
1642
- :any:`ot.gpu` : depends on :code:`cupy` and a CUDA GPU.
43+
- :any:`ot.plot` : depends on :code:`matplotlib`
1744
1845
"""
1946

ot/dr.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# -*- coding: utf-8 -*-
22
"""
33
Dimension reduction with optimal transport
4+
5+
6+
.. warning::
7+
Note that by default the module is not import in :mod:`ot`. In order to
8+
use it you need to explicitely import :mod:`ot.dr`
9+
410
"""
511

612
# Author: Remi Flamary <[email protected]>

ot/gpu/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<https://cupy.chainer.org/>`_.
77
88
.. warning::
9-
Note that by default the module is not import in :mod:`ot`. in order to
10-
use it you need to import :mod:`ot.gpu` .
9+
Note that by default the module is not import in :mod:`ot`. In order to
10+
use it you need to explicitely import :mod:`ot.gpu` .
1111
1212
By default, the functions in this module accept and return numpy arrays
1313
in order to proide drop-in replacement for the other POT function but

ot/lp/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,14 +544,13 @@ def wasserstein_1d(x_a, x_b, a=None, b=None, p=1.):
544544
r"""Solves the p-Wasserstein distance problem between 1d measures and returns
545545
the distance
546546
547-
548547
.. math::
549-
\gamma = arg\min_\gamma \left( \sum_i \sum_j \gamma_{ij}
550-
|x_a[i] - x_b[j]|^p \\right)^{1/p}
548+
\min_\gamma \left( \sum_i \sum_j \gamma_{ij} \|x_a[i] - x_b[j]\|^p \right)^{1/p}
551549
552550
s.t. \gamma 1 = a,
553551
\gamma^T 1= b,
554552
\gamma\geq 0
553+
555554
where :
556555
557556
- x_a and x_b are the samples

ot/plot.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
"""
22
Functions for plotting OT matrices
3+
4+
.. warning::
5+
Note that by default the module is not import in :mod:`ot`. In order to
6+
use it you need to explicitely import :mod:`ot.plot`
7+
8+
39
"""
410

511
# Author: Remi Flamary <[email protected]>

ot/stochastic.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
"""
2+
Stochastic solvers for regularized OT.
3+
4+
5+
"""
6+
17
# Author: Kilian Fatras <[email protected]>
28
#
39
# License: MIT License

ot/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Various function that can be usefull
3+
Various useful functions
44
"""
55

66
# Author: Remi Flamary <[email protected]>

0 commit comments

Comments
 (0)