summaryrefslogtreecommitdiff
path: root/docs/source/auto_examples/plot_gromov_barycenter.rst
diff options
context:
space:
mode:
authorRémi Flamary <remi.flamary@gmail.com>2020-04-20 15:19:09 +0200
committerRémi Flamary <remi.flamary@gmail.com>2020-04-20 15:19:09 +0200
commite65606ae498bd611f6a994868c2a66dfbea403cd (patch)
treeb9b43dcaf8499b6d57b806ce04350fb6b792537f /docs/source/auto_examples/plot_gromov_barycenter.rst
parent8acaf262baa04a4d2bdd9c774c45c5bb2fb2d12a (diff)
big update examples
Diffstat (limited to 'docs/source/auto_examples/plot_gromov_barycenter.rst')
-rw-r--r--docs/source/auto_examples/plot_gromov_barycenter.rst62
1 files changed, 41 insertions, 21 deletions
diff --git a/docs/source/auto_examples/plot_gromov_barycenter.rst b/docs/source/auto_examples/plot_gromov_barycenter.rst
index 531ee22..995cca7 100644
--- a/docs/source/auto_examples/plot_gromov_barycenter.rst
+++ b/docs/source/auto_examples/plot_gromov_barycenter.rst
@@ -1,6 +1,12 @@
+.. only:: html
+
+ .. note::
+ :class: sphx-glr-download-link-note
+ Click :ref:`here <sphx_glr_download_auto_examples_plot_gromov_barycenter.py>` to download the full example code
+ .. rst-class:: sphx-glr-example-title
-.. _sphx_glr_auto_examples_plot_gromov_barycenter.py:
+ .. _sphx_glr_auto_examples_plot_gromov_barycenter.py:
=====================================
@@ -11,8 +17,7 @@ This example is designed to show how to use the Gromov-Wasserstein distance
computation in POT.
-
-.. code-block:: python
+.. code-block:: default
# Author: Erwan Vautier <erwan.vautier@gmail.com>
@@ -24,7 +29,6 @@ computation in POT.
import numpy as np
import scipy as sp
- import scipy.ndimage as spi
import matplotlib.pylab as pl
from sklearn import manifold
from sklearn.decomposition import PCA
@@ -37,6 +41,7 @@ computation in POT.
+
Smacof MDS
----------
@@ -44,8 +49,7 @@ This function allows to find an embedding of points given a dissimilarity matrix
that will be given by the output of the algorithm
-
-.. code-block:: python
+.. code-block:: default
@@ -101,14 +105,14 @@ that will be given by the output of the algorithm
+
Data preparation
----------------
The four distributions are constructed from 4 simple images
-
-.. code-block:: python
+.. code-block:: default
@@ -117,10 +121,10 @@ The four distributions are constructed from 4 simple images
return I.reshape((I.shape[0] * I.shape[1], I.shape[2]))
- square = spi.imread('../data/square.png').astype(np.float64)[:, :, 2] / 256
- cross = spi.imread('../data/cross.png').astype(np.float64)[:, :, 2] / 256
- triangle = spi.imread('../data/triangle.png').astype(np.float64)[:, :, 2] / 256
- star = spi.imread('../data/star.png').astype(np.float64)[:, :, 2] / 256
+ square = pl.imread('../data/square.png').astype(np.float64)[:, :, 2] / 256
+ cross = pl.imread('../data/cross.png').astype(np.float64)[:, :, 2] / 256
+ triangle = pl.imread('../data/triangle.png').astype(np.float64)[:, :, 2] / 256
+ star = pl.imread('../data/star.png').astype(np.float64)[:, :, 2] / 256
shapes = [square, cross, triangle, star]
@@ -143,12 +147,12 @@ The four distributions are constructed from 4 simple images
+
Barycenter computation
----------------------
-
-.. code-block:: python
+.. code-block:: default
@@ -200,14 +204,14 @@ Barycenter computation
+
Visualization
-------------
The PCA helps in getting consistency between the rotations
-
-.. code-block:: python
+.. code-block:: default
@@ -297,27 +301,43 @@ The PCA helps in getting consistency between the rotations
.. image:: /auto_examples/images/sphx_glr_plot_gromov_barycenter_001.png
- :align: center
+ :class: sphx-glr-single-img
+
+
+.. rst-class:: sphx-glr-script-out
+
+ Out:
+
+ .. code-block:: none
+ <matplotlib.collections.PathCollection object at 0x7ff28e5d6080>
-**Total running time of the script:** ( 0 minutes 5.906 seconds)
+.. rst-class:: sphx-glr-timing
+
+ **Total running time of the script:** ( 0 minutes 1.747 seconds)
+
+
+.. _sphx_glr_download_auto_examples_plot_gromov_barycenter.py:
+
.. only :: html
.. container:: sphx-glr-footer
+ :class: sphx-glr-footer-example
+
- .. container:: sphx-glr-download
+ .. container:: sphx-glr-download sphx-glr-download-python
:download:`Download Python source code: plot_gromov_barycenter.py <plot_gromov_barycenter.py>`
- .. container:: sphx-glr-download
+ .. container:: sphx-glr-download sphx-glr-download-jupyter
:download:`Download Jupyter notebook: plot_gromov_barycenter.ipynb <plot_gromov_barycenter.ipynb>`
@@ -326,4 +346,4 @@ The PCA helps in getting consistency between the rotations
.. rst-class:: sphx-glr-signature
- `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
+ `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_