From fab20da2af763d8f108e6ceb88d888fcc5497747 Mon Sep 17 00:00:00 2001 From: RĂ©mi Flamary Date: Thu, 6 Jul 2017 10:41:06 +0200 Subject: update readme --- docs/source/readme.rst | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) (limited to 'docs/source/readme.rst') diff --git a/docs/source/readme.rst b/docs/source/readme.rst index 6898296..611001b 100644 --- a/docs/source/readme.rst +++ b/docs/source/readme.rst @@ -93,11 +93,51 @@ obviously you need CUDA installed and a compatible GPU. Examples -------- +Short examples +~~~~~~~~~~~~~~ + +- Import the toolbox + + .. code:: python + + import ot + +- Compute Wasserstein distances + + .. code:: python + + # a,b are 1D histograms (sum to 1 and positive) + # M is the ground cost matrix + Wd=ot.emd2(a,b,M) # exact linear program + # if b is a matrix compute all distances to a and return a vector + +- Compute OT matrix + + .. code:: python + + # a,b are 1D histograms (sum to 1 and positive) + # M is the ground cost matrix + Totp=ot.emd(a,b,M) # exact linear program + Totp_reg=ot.sinkhorn(a,b,M,reg) # entropic regularized OT + +- Compute Wasserstein barycenter + + .. code:: python + + # A is a n*d matrix containing d 1D histograms + # M is the ground cost matrix + ba=ot.barycenter(A,M,reg) # reg is regularization parameter + +Examples and Notebooks +~~~~~~~~~~~~~~~~~~~~~~ + The examples folder contain several examples and use case for the library. The full documentation is available on -`Readthedocs `__ +`Readthedocs `__. -Here is a list of the Python notebooks if you want a quick look: +Here is a list of the Python notebooks available +`here `__ if you +want a quick look: - `1D optimal transport `__ @@ -123,7 +163,7 @@ Here is a list of the Python notebooks if you want a quick look: Analysis `__ You can also see the notebooks with `Jupyter -nbviewer `__. +nbviewer `__. Acknowledgements ---------------- -- cgit v1.2.3