From e65606ae498bd611f6a994868c2a66dfbea403cd Mon Sep 17 00:00:00 2001 From: RĂ©mi Flamary Date: Mon, 20 Apr 2020 15:19:09 +0200 Subject: big update examples --- docs/source/auto_examples/plot_UOT_1D.rst | 68 ++++++++++++++++--------------- 1 file changed, 36 insertions(+), 32 deletions(-) (limited to 'docs/source/auto_examples/plot_UOT_1D.rst') diff --git a/docs/source/auto_examples/plot_UOT_1D.rst b/docs/source/auto_examples/plot_UOT_1D.rst index 8e618b4..f43b0c1 100644 --- a/docs/source/auto_examples/plot_UOT_1D.rst +++ b/docs/source/auto_examples/plot_UOT_1D.rst @@ -1,6 +1,12 @@ +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + Click :ref:`here ` to download the full example code + .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_plot_UOT_1D.py: + .. _sphx_glr_auto_examples_plot_UOT_1D.py: =============================== @@ -11,8 +17,7 @@ This example illustrates the computation of Unbalanced Optimal transport using a Kullback-Leibler relaxation. - -.. code-block:: python +.. code-block:: default # Author: Hicham Janati @@ -31,17 +36,14 @@ using a Kullback-Leibler relaxation. + Generate data ------------- - -.. code-block:: python +.. code-block:: default - - #%% parameters - n = 100 # nb bins # bin positions @@ -65,15 +67,13 @@ Generate data + Plot distributions and loss matrix ---------------------------------- +.. code-block:: default -.. code-block:: python - - - #%% plot the distributions pl.figure(1, figsize=(6.4, 3)) pl.plot(x, a, 'b', label='Source distribution') @@ -95,12 +95,13 @@ Plot distributions and loss matrix * .. image:: /auto_examples/images/sphx_glr_plot_UOT_1D_001.png - :scale: 47 + :class: sphx-glr-multi-img * .. image:: /auto_examples/images/sphx_glr_plot_UOT_1D_002.png - :scale: 47 + :class: sphx-glr-multi-img + @@ -109,8 +110,7 @@ Solve Unbalanced Sinkhorn -------------- - -.. code-block:: python +.. code-block:: default @@ -127,41 +127,45 @@ Solve Unbalanced Sinkhorn -.. image:: /auto_examples/images/sphx_glr_plot_UOT_1D_006.png - :align: center +.. image:: /auto_examples/images/sphx_glr_plot_UOT_1D_003.png + :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out - Out:: + Out: + + .. code-block:: none + + /home/rflamary/PYTHON/POT/examples/plot_UOT_1D.py:76: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure. + pl.show() + - It. |Err - ------------------- - 0|1.838786e+00| - 10|1.242379e-01| - 20|2.581314e-03| - 30|5.674552e-05| - 40|1.252959e-06| - 50|2.768136e-08| - 60|6.116090e-10| -**Total running time of the script:** ( 0 minutes 0.259 seconds) +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** ( 0 minutes 0.274 seconds) + + +.. _sphx_glr_download_auto_examples_plot_UOT_1D.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_UOT_1D.py ` - .. container:: sphx-glr-download + .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_UOT_1D.ipynb ` @@ -170,4 +174,4 @@ Solve Unbalanced Sinkhorn .. rst-class:: sphx-glr-signature - `Gallery generated by Sphinx-Gallery `_ + `Gallery generated by Sphinx-Gallery `_ -- cgit v1.2.3