|
| 1 | +""" |
| 2 | +
|
| 3 | +This is the main module of the POT toolbox. It provides easy access to |
| 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. |
| 31 | + - :any:`ot.partial` contains solvers for partial OT. |
| 32 | +
|
| 33 | +.. warning:: |
| 34 | + The list of automatically imported sub-modules is as follows: |
| 35 | + :py:mod:`ot.lp`, :py:mod:`ot.bregman`, :py:mod:`ot.optim` |
| 36 | + :py:mod:`ot.utils`, :py:mod:`ot.datasets`, |
| 37 | + :py:mod:`ot.gromov`, :py:mod:`ot.smooth` |
| 38 | + :py:mod:`ot.stochastic` |
| 39 | +
|
| 40 | + The following sub-modules are not imported due to additional dependencies: |
| 41 | +
|
| 42 | + - :any:`ot.dr` : depends on :code:`pymanopt` and :code:`autograd`. |
| 43 | + - :any:`ot.gpu` : depends on :code:`cupy` and a CUDA GPU. |
| 44 | + - :any:`ot.plot` : depends on :code:`matplotlib` |
| 45 | +
|
| 46 | +""" |
| 47 | + |
| 48 | +# Author: Remi Flamary <[email protected]> |
| 49 | +# Nicolas Courty <[email protected]> |
| 50 | +# |
| 51 | +# License: MIT License |
| 52 | + |
| 53 | + |
| 54 | +# All submodules and packages |
| 55 | +from . import lp |
| 56 | +from . import bregman |
| 57 | +from . import optim |
| 58 | +from . import utils |
| 59 | +from . import datasets |
| 60 | +from . import da |
| 61 | +from . import gromov |
| 62 | +from . import smooth |
| 63 | +from . import stochastic |
| 64 | +from . import unbalanced |
| 65 | +from . import partial |
| 66 | + |
| 67 | +# OT functions |
| 68 | +from .lp import emd, emd2, emd_1d, emd2_1d, wasserstein_1d |
| 69 | +from .bregman import sinkhorn, sinkhorn2, barycenter |
| 70 | +from .unbalanced import sinkhorn_unbalanced, barycenter_unbalanced, sinkhorn_unbalanced2 |
| 71 | +from .da import sinkhorn_lpl1_mm |
| 72 | + |
| 73 | +# utils functions |
| 74 | +from .utils import dist, unif, tic, toc, toq |
| 75 | + |
| 76 | +__version__ = "0.6.0" |
| 77 | + |
| 78 | +__all__ = ['emd', 'emd2', 'emd_1d', 'sinkhorn', 'sinkhorn2', 'utils', 'datasets', |
| 79 | + 'bregman', 'lp', 'tic', 'toc', 'toq', 'gromov', |
| 80 | + 'emd_1d', 'emd2_1d', 'wasserstein_1d', |
| 81 | + 'dist', 'unif', 'barycenter', 'sinkhorn_lpl1_mm', 'da', 'optim', |
| 82 | + 'sinkhorn_unbalanced', 'barycenter_unbalanced', |
| 83 | + 'sinkhorn_unbalanced2'] |
0 commit comments