summaryrefslogtreecommitdiff
path: root/docs/source
diff options
context:
space:
mode:
Diffstat (limited to 'docs/source')
-rw-r--r--docs/source/auto_examples/auto_examples_jupyter.zipbin67774 -> 89148 bytes
-rw-r--r--docs/source/auto_examples/auto_examples_python.zipbin44112 -> 59370 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_gromov_001.pngbin0 -> 46633 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_gromov_002.pngbin0 -> 16945 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_gromov_003.pngbin0 -> 16530 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_gromov_barycenter_001.pngbin0 -> 47537 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_optim_OTreg_006.pngbin19189 -> 19258 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_classes_001.pngbin51418 -> 50899 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_classes_003.pngbin199721 -> 197590 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_001.pngbin144945 -> 144957 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_003.pngbin50403 -> 50401 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_005.pngbin234386 -> 234564 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_d2_001.pngbin135206 -> 131063 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_d2_003.pngbin241976 -> 213055 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_d2_006.pngbin108946 -> 99762 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_001.pngbin35881 -> 36766 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_003.pngbin73815 -> 75842 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_001.pngbin165589 -> 165592 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_003.pngbin80727 -> 80722 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_004.pngbin541463 -> 541314 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_semi_supervised_001.pngbin0 -> 153695 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_semi_supervised_003.pngbin0 -> 37987 bytes
-rw-r--r--docs/source/auto_examples/images/sphx_glr_plot_otda_semi_supervised_006.pngbin0 -> 74267 bytes
-rw-r--r--docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_classes_thumb.pngbin30678 -> 30868 bytes
-rw-r--r--docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_color_images_thumb.pngbin51088 -> 51085 bytes
-rw-r--r--docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_d2_thumb.pngbin53014 -> 52743 bytes
-rw-r--r--docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_mapping_colors_images_thumb.pngbin58321 -> 58315 bytes
-rw-r--r--docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_mapping_thumb.pngbin18473 -> 18478 bytes
-rw-r--r--docs/source/auto_examples/index.rst326
-rw-r--r--docs/source/auto_examples/plot_gromov.ipynb126
-rw-r--r--docs/source/auto_examples/plot_gromov.py93
-rw-r--r--docs/source/auto_examples/plot_gromov.rst180
-rw-r--r--docs/source/auto_examples/plot_gromov_barycenter.ipynb126
-rw-r--r--docs/source/auto_examples/plot_gromov_barycenter.py248
-rw-r--r--docs/source/auto_examples/plot_gromov_barycenter.rst324
-rw-r--r--docs/source/auto_examples/plot_optim_OTreg.rst379
-rw-r--r--docs/source/auto_examples/plot_otda_classes.rst46
-rw-r--r--docs/source/auto_examples/plot_otda_color_images.rst4
-rw-r--r--docs/source/auto_examples/plot_otda_d2.rst4
-rw-r--r--docs/source/auto_examples/plot_otda_mapping.rst38
-rw-r--r--docs/source/auto_examples/plot_otda_mapping_colors_images.rst66
-rw-r--r--docs/source/auto_examples/plot_otda_semi_supervised.ipynb144
-rw-r--r--docs/source/auto_examples/plot_otda_semi_supervised.py148
-rw-r--r--docs/source/auto_examples/plot_otda_semi_supervised.rst240
-rw-r--r--docs/source/conf.py4
45 files changed, 2211 insertions, 285 deletions
diff --git a/docs/source/auto_examples/auto_examples_jupyter.zip b/docs/source/auto_examples/auto_examples_jupyter.zip
index fc1d4de..5a3f24c 100644
--- a/docs/source/auto_examples/auto_examples_jupyter.zip
+++ b/docs/source/auto_examples/auto_examples_jupyter.zip
Binary files differ
diff --git a/docs/source/auto_examples/auto_examples_python.zip b/docs/source/auto_examples/auto_examples_python.zip
index 282bc58..aa06bb6 100644
--- a/docs/source/auto_examples/auto_examples_python.zip
+++ b/docs/source/auto_examples/auto_examples_python.zip
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_gromov_001.png b/docs/source/auto_examples/images/sphx_glr_plot_gromov_001.png
new file mode 100644
index 0000000..b4571fa
--- /dev/null
+++ b/docs/source/auto_examples/images/sphx_glr_plot_gromov_001.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_gromov_002.png b/docs/source/auto_examples/images/sphx_glr_plot_gromov_002.png
new file mode 100644
index 0000000..58c02d7
--- /dev/null
+++ b/docs/source/auto_examples/images/sphx_glr_plot_gromov_002.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_gromov_003.png b/docs/source/auto_examples/images/sphx_glr_plot_gromov_003.png
new file mode 100644
index 0000000..73a322d
--- /dev/null
+++ b/docs/source/auto_examples/images/sphx_glr_plot_gromov_003.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_gromov_barycenter_001.png b/docs/source/auto_examples/images/sphx_glr_plot_gromov_barycenter_001.png
new file mode 100644
index 0000000..715a116
--- /dev/null
+++ b/docs/source/auto_examples/images/sphx_glr_plot_gromov_barycenter_001.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_optim_OTreg_006.png b/docs/source/auto_examples/images/sphx_glr_plot_optim_OTreg_006.png
index 0af4542..60078c1 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_optim_OTreg_006.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_optim_OTreg_006.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_classes_001.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_classes_001.png
index bedc950..48fad93 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_otda_classes_001.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_classes_001.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_classes_003.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_classes_003.png
index 8e3ccad..c92d5c1 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_otda_classes_003.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_classes_003.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_001.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_001.png
index 2d851c7..95f882a 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_001.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_001.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_003.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_003.png
index a1d99ab..aa1a5d3 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_003.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_003.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_005.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_005.png
index f76619b..d219bb3 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_005.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_color_images_005.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_d2_001.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_d2_001.png
index 3d6a740..ef8cfd1 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_otda_d2_001.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_d2_001.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_d2_003.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_d2_003.png
index aa16585..1ba5b1b 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_otda_d2_003.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_d2_003.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_d2_006.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_d2_006.png
index 5dc3ba7..d67fea1 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_otda_d2_006.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_d2_006.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_001.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_001.png
index 4239465..8da464b 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_001.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_001.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_003.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_003.png
index 620105e..fa93ee5 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_003.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_003.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_001.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_001.png
index 1182082..33134fc 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_001.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_001.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_003.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_003.png
index cc2e4cd..42197e3 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_003.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_003.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_004.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_004.png
index 7a68343..d9101da 100644
--- a/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_004.png
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_mapping_colors_images_004.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_semi_supervised_001.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_semi_supervised_001.png
new file mode 100644
index 0000000..324aee3
--- /dev/null
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_semi_supervised_001.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_semi_supervised_003.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_semi_supervised_003.png
new file mode 100644
index 0000000..8ad6ca2
--- /dev/null
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_semi_supervised_003.png
Binary files differ
diff --git a/docs/source/auto_examples/images/sphx_glr_plot_otda_semi_supervised_006.png b/docs/source/auto_examples/images/sphx_glr_plot_otda_semi_supervised_006.png
new file mode 100644
index 0000000..b4eacb7
--- /dev/null
+++ b/docs/source/auto_examples/images/sphx_glr_plot_otda_semi_supervised_006.png
Binary files differ
diff --git a/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_classes_thumb.png b/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_classes_thumb.png
index a72fe37..561c5bb 100644
--- a/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_classes_thumb.png
+++ b/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_classes_thumb.png
Binary files differ
diff --git a/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_color_images_thumb.png b/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_color_images_thumb.png
index 16b7572..a919055 100644
--- a/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_color_images_thumb.png
+++ b/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_color_images_thumb.png
Binary files differ
diff --git a/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_d2_thumb.png b/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_d2_thumb.png
index cddf768..bd32092 100644
--- a/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_d2_thumb.png
+++ b/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_d2_thumb.png
Binary files differ
diff --git a/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_mapping_colors_images_thumb.png b/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_mapping_colors_images_thumb.png
index 9666955..f7fd217 100644
--- a/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_mapping_colors_images_thumb.png
+++ b/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_mapping_colors_images_thumb.png
Binary files differ
diff --git a/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_mapping_thumb.png b/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_mapping_thumb.png
index 959cc44..37d99bd 100644
--- a/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_mapping_thumb.png
+++ b/docs/source/auto_examples/images/thumb/sphx_glr_plot_otda_mapping_thumb.png
Binary files differ
diff --git a/docs/source/auto_examples/index.rst b/docs/source/auto_examples/index.rst
index e69de29..eb54ca8 100644
--- a/docs/source/auto_examples/index.rst
+++ b/docs/source/auto_examples/index.rst
@@ -0,0 +1,326 @@
+POT Examples
+============
+
+This is a gallery of all the POT example files.
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the computation of EMD and Sinkhorn transport plans and their visualiz...">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_OT_1D_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_OT_1D.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_OT_1D
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="Illustrates the use of the generic solver for regularized OT with user-designed regularization ...">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_optim_OTreg_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_optim_OTreg.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_optim_OTreg
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="This example is designed to show how to use the Gromov-Wassertsein distance computation in POT....">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_gromov_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_gromov.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_gromov
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="Illustration of 2D optimal transport between discributions that are weighted sum of diracs. The...">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_OT_2D_samples_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_OT_2D_samples.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_OT_2D_samples
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="Shows how to compute multiple EMD and Sinkhorn with two differnt ground metrics and plot their ...">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_compute_emd_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_compute_emd.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_compute_emd
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="This example illustrate the use of WDA as proposed in [11].">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_WDA_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_WDA.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_WDA
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="This example presents a way of transferring colors between two image with Optimal Transport as ...">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_otda_color_images_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_otda_color_images.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_otda_color_images
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the computation of regularized Wassersyein Barycenter as proposed in [...">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_barycenter_1D_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_barycenter_1D.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_barycenter_1D
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="OT for domain adaptation with image color adaptation [6] with mapping estimation [8].">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_otda_mapping_colors_images_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_otda_mapping_colors_images.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_otda_mapping_colors_images
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="This example presents how to use MappingTransport to estimate at the same time both the couplin...">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_otda_mapping_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_otda_mapping.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_otda_mapping
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="This example introduces a semi supervised domain adaptation in a 2D setting. It explicits the p...">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_otda_semi_supervised_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_otda_semi_supervised.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_otda_semi_supervised
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="This example introduces a domain adaptation in a 2D setting and the 4 OTDA approaches currently...">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_otda_classes_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_otda_classes.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_otda_classes
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="This example introduces a domain adaptation in a 2D setting. It explicits the problem of domain...">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_otda_d2_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_otda_d2.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_otda_d2
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="2D OT on empirical distributio with different gound metric.">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_OT_L1_vs_L2_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_OT_L1_vs_L2.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_OT_L1_vs_L2
+
+.. raw:: html
+
+ <div class="sphx-glr-thumbcontainer" tooltip="This example is designed to show how to use the Gromov-Wasserstein distance computation in POT....">
+
+.. only:: html
+
+ .. figure:: /auto_examples/images/thumb/sphx_glr_plot_gromov_barycenter_thumb.png
+
+ :ref:`sphx_glr_auto_examples_plot_gromov_barycenter.py`
+
+.. raw:: html
+
+ </div>
+
+
+.. toctree::
+ :hidden:
+
+ /auto_examples/plot_gromov_barycenter
+.. raw:: html
+
+ <div style='clear:both'></div>
+
+
+
+.. container:: sphx-glr-footer
+
+
+ .. container:: sphx-glr-download
+
+ :download:`Download all examples in Python source code: auto_examples_python.zip </auto_examples/auto_examples_python.zip>`
+
+
+
+ .. container:: sphx-glr-download
+
+ :download:`Download all examples in Jupyter notebooks: auto_examples_jupyter.zip </auto_examples/auto_examples_jupyter.zip>`
+
+.. rst-class:: sphx-glr-signature
+
+ `Generated by Sphinx-Gallery <http://sphinx-gallery.readthedocs.io>`_
diff --git a/docs/source/auto_examples/plot_gromov.ipynb b/docs/source/auto_examples/plot_gromov.ipynb
new file mode 100644
index 0000000..865848e
--- /dev/null
+++ b/docs/source/auto_examples/plot_gromov.ipynb
@@ -0,0 +1,126 @@
+{
+ "nbformat_minor": 0,
+ "nbformat": 4,
+ "cells": [
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "%matplotlib inline"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "\n# Gromov-Wasserstein example\n\n\nThis example is designed to show how to use the Gromov-Wassertsein distance\ncomputation in POT.\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "# Author: Erwan Vautier <erwan.vautier@gmail.com>\r\n# Nicolas Courty <ncourty@irisa.fr>\r\n#\r\n# License: MIT License\r\n\r\nimport scipy as sp\r\nimport numpy as np\r\nimport matplotlib.pylab as pl\r\nfrom mpl_toolkits.mplot3d import Axes3D # noqa\r\nimport ot"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "Sample two Gaussian distributions (2D and 3D)\r\n ---------------------------------------------\r\n\r\n The Gromov-Wasserstein distance allows to compute distances with samples that\r\n do not belong to the same metric space. For demonstration purpose, we sample\r\n two Gaussian distributions in 2- and 3-dimensional spaces.\r\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "n_samples = 30 # nb samples\r\n\r\nmu_s = np.array([0, 0])\r\ncov_s = np.array([[1, 0], [0, 1]])\r\n\r\nmu_t = np.array([4, 4, 4])\r\ncov_t = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])\r\n\r\n\r\nxs = ot.datasets.get_2D_samples_gauss(n_samples, mu_s, cov_s)\r\nP = sp.linalg.sqrtm(cov_t)\r\nxt = np.random.randn(n_samples, 3).dot(P) + mu_t"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "Plotting the distributions\r\n--------------------------\r\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "fig = pl.figure()\r\nax1 = fig.add_subplot(121)\r\nax1.plot(xs[:, 0], xs[:, 1], '+b', label='Source samples')\r\nax2 = fig.add_subplot(122, projection='3d')\r\nax2.scatter(xt[:, 0], xt[:, 1], xt[:, 2], color='r')\r\npl.show()"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "Compute distance kernels, normalize them and then display\r\n---------------------------------------------------------\r\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "C1 = sp.spatial.distance.cdist(xs, xs)\r\nC2 = sp.spatial.distance.cdist(xt, xt)\r\n\r\nC1 /= C1.max()\r\nC2 /= C2.max()\r\n\r\npl.figure()\r\npl.subplot(121)\r\npl.imshow(C1)\r\npl.subplot(122)\r\npl.imshow(C2)\r\npl.show()"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "Compute Gromov-Wasserstein plans and distance\r\n---------------------------------------------\r\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "p = ot.unif(n_samples)\r\nq = ot.unif(n_samples)\r\n\r\ngw = ot.gromov_wasserstein(C1, C2, p, q, 'square_loss', epsilon=5e-4)\r\ngw_dist = ot.gromov_wasserstein2(C1, C2, p, q, 'square_loss', epsilon=5e-4)\r\n\r\nprint('Gromov-Wasserstein distances between the distribution: ' + str(gw_dist))\r\n\r\npl.figure()\r\npl.imshow(gw, cmap='jet')\r\npl.colorbar()\r\npl.show()"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "name": "python2",
+ "language": "python"
+ },
+ "language_info": {
+ "mimetype": "text/x-python",
+ "nbconvert_exporter": "python",
+ "name": "python",
+ "file_extension": ".py",
+ "version": "2.7.12",
+ "pygments_lexer": "ipython2",
+ "codemirror_mode": {
+ "version": 2,
+ "name": "ipython"
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/docs/source/auto_examples/plot_gromov.py b/docs/source/auto_examples/plot_gromov.py
new file mode 100644
index 0000000..d3f724c
--- /dev/null
+++ b/docs/source/auto_examples/plot_gromov.py
@@ -0,0 +1,93 @@
+# -*- coding: utf-8 -*-
+"""
+==========================
+Gromov-Wasserstein example
+==========================
+
+This example is designed to show how to use the Gromov-Wassertsein distance
+computation in POT.
+"""
+
+# Author: Erwan Vautier <erwan.vautier@gmail.com>
+# Nicolas Courty <ncourty@irisa.fr>
+#
+# License: MIT License
+
+import scipy as sp
+import numpy as np
+import matplotlib.pylab as pl
+from mpl_toolkits.mplot3d import Axes3D # noqa
+import ot
+
+
+##############################################################################
+# Sample two Gaussian distributions (2D and 3D)
+# ---------------------------------------------
+#
+# The Gromov-Wasserstein distance allows to compute distances with samples that
+# do not belong to the same metric space. For demonstration purpose, we sample
+# two Gaussian distributions in 2- and 3-dimensional spaces.
+
+
+n_samples = 30 # nb samples
+
+mu_s = np.array([0, 0])
+cov_s = np.array([[1, 0], [0, 1]])
+
+mu_t = np.array([4, 4, 4])
+cov_t = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
+
+
+xs = ot.datasets.get_2D_samples_gauss(n_samples, mu_s, cov_s)
+P = sp.linalg.sqrtm(cov_t)
+xt = np.random.randn(n_samples, 3).dot(P) + mu_t
+
+
+##############################################################################
+# Plotting the distributions
+# --------------------------
+
+
+fig = pl.figure()
+ax1 = fig.add_subplot(121)
+ax1.plot(xs[:, 0], xs[:, 1], '+b', label='Source samples')
+ax2 = fig.add_subplot(122, projection='3d')
+ax2.scatter(xt[:, 0], xt[:, 1], xt[:, 2], color='r')
+pl.show()
+
+
+##############################################################################
+# Compute distance kernels, normalize them and then display
+# ---------------------------------------------------------
+
+
+C1 = sp.spatial.distance.cdist(xs, xs)
+C2 = sp.spatial.distance.cdist(xt, xt)
+
+C1 /= C1.max()
+C2 /= C2.max()
+
+pl.figure()
+pl.subplot(121)
+pl.imshow(C1)
+pl.subplot(122)
+pl.imshow(C2)
+pl.show()
+
+##############################################################################
+# Compute Gromov-Wasserstein plans and distance
+# ---------------------------------------------
+
+
+p = ot.unif(n_samples)
+q = ot.unif(n_samples)
+
+gw = ot.gromov_wasserstein(C1, C2, p, q, 'square_loss', epsilon=5e-4)
+gw_dist = ot.gromov_wasserstein2(C1, C2, p, q, 'square_loss', epsilon=5e-4)
+
+print('Gromov-Wasserstein distances between the distribution: ' + str(gw_dist))
+
+pl.figure()
+pl.imshow(gw, cmap='jet')
+pl.colorbar()
+pl.show()
diff --git a/docs/source/auto_examples/plot_gromov.rst b/docs/source/auto_examples/plot_gromov.rst
new file mode 100644
index 0000000..65cf4e4
--- /dev/null
+++ b/docs/source/auto_examples/plot_gromov.rst
@@ -0,0 +1,180 @@
+
+
+.. _sphx_glr_auto_examples_plot_gromov.py:
+
+
+==========================
+Gromov-Wasserstein example
+==========================
+
+This example is designed to show how to use the Gromov-Wassertsein distance
+computation in POT.
+
+
+
+.. code-block:: python
+
+
+ # Author: Erwan Vautier <erwan.vautier@gmail.com>
+ # Nicolas Courty <ncourty@irisa.fr>
+ #
+ # License: MIT License
+
+ import scipy as sp
+ import numpy as np
+ import matplotlib.pylab as pl
+ from mpl_toolkits.mplot3d import Axes3D # noqa
+ import ot
+
+
+
+
+
+
+
+
+Sample two Gaussian distributions (2D and 3D)
+ ---------------------------------------------
+
+ The Gromov-Wasserstein distance allows to compute distances with samples that
+ do not belong to the same metric space. For demonstration purpose, we sample
+ two Gaussian distributions in 2- and 3-dimensional spaces.
+
+
+
+.. code-block:: python
+
+
+
+ n_samples = 30 # nb samples
+
+ mu_s = np.array([0, 0])
+ cov_s = np.array([[1, 0], [0, 1]])
+
+ mu_t = np.array([4, 4, 4])
+ cov_t = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
+
+
+ xs = ot.datasets.get_2D_samples_gauss(n_samples, mu_s, cov_s)
+ P = sp.linalg.sqrtm(cov_t)
+ xt = np.random.randn(n_samples, 3).dot(P) + mu_t
+
+
+
+
+
+
+
+
+Plotting the distributions
+--------------------------
+
+
+
+.. code-block:: python
+
+
+
+ fig = pl.figure()
+ ax1 = fig.add_subplot(121)
+ ax1.plot(xs[:, 0], xs[:, 1], '+b', label='Source samples')
+ ax2 = fig.add_subplot(122, projection='3d')
+ ax2.scatter(xt[:, 0], xt[:, 1], xt[:, 2], color='r')
+ pl.show()
+
+
+
+
+
+.. image:: /auto_examples/images/sphx_glr_plot_gromov_001.png
+ :align: center
+
+
+
+
+Compute distance kernels, normalize them and then display
+---------------------------------------------------------
+
+
+
+.. code-block:: python
+
+
+
+ C1 = sp.spatial.distance.cdist(xs, xs)
+ C2 = sp.spatial.distance.cdist(xt, xt)
+
+ C1 /= C1.max()
+ C2 /= C2.max()
+
+ pl.figure()
+ pl.subplot(121)
+ pl.imshow(C1)
+ pl.subplot(122)
+ pl.imshow(C2)
+ pl.show()
+
+
+
+
+.. image:: /auto_examples/images/sphx_glr_plot_gromov_002.png
+ :align: center
+
+
+
+
+Compute Gromov-Wasserstein plans and distance
+---------------------------------------------
+
+
+
+.. code-block:: python
+
+
+
+ p = ot.unif(n_samples)
+ q = ot.unif(n_samples)
+
+ gw = ot.gromov_wasserstein(C1, C2, p, q, 'square_loss', epsilon=5e-4)
+ gw_dist = ot.gromov_wasserstein2(C1, C2, p, q, 'square_loss', epsilon=5e-4)
+
+ print('Gromov-Wasserstein distances between the distribution: ' + str(gw_dist))
+
+ pl.figure()
+ pl.imshow(gw, cmap='jet')
+ pl.colorbar()
+ pl.show()
+
+
+
+.. image:: /auto_examples/images/sphx_glr_plot_gromov_003.png
+ :align: center
+
+
+.. rst-class:: sphx-glr-script-out
+
+ Out::
+
+ Gromov-Wasserstein distances between the distribution: 0.225058076974
+
+
+**Total running time of the script:** ( 0 minutes 4.070 seconds)
+
+
+
+.. container:: sphx-glr-footer
+
+
+ .. container:: sphx-glr-download
+
+ :download:`Download Python source code: plot_gromov.py <plot_gromov.py>`
+
+
+
+ .. container:: sphx-glr-download
+
+ :download:`Download Jupyter notebook: plot_gromov.ipynb <plot_gromov.ipynb>`
+
+.. rst-class:: sphx-glr-signature
+
+ `Generated by Sphinx-Gallery <http://sphinx-gallery.readthedocs.io>`_
diff --git a/docs/source/auto_examples/plot_gromov_barycenter.ipynb b/docs/source/auto_examples/plot_gromov_barycenter.ipynb
new file mode 100644
index 0000000..d38dfbb
--- /dev/null
+++ b/docs/source/auto_examples/plot_gromov_barycenter.ipynb
@@ -0,0 +1,126 @@
+{
+ "nbformat_minor": 0,
+ "nbformat": 4,
+ "cells": [
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "%matplotlib inline"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "\n# Gromov-Wasserstein Barycenter example\n\n\nThis example is designed to show how to use the Gromov-Wasserstein distance\ncomputation in POT.\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "# Author: Erwan Vautier <erwan.vautier@gmail.com>\r\n# Nicolas Courty <ncourty@irisa.fr>\r\n#\r\n# License: MIT License\r\n\r\n\r\nimport numpy as np\r\nimport scipy as sp\r\n\r\nimport scipy.ndimage as spi\r\nimport matplotlib.pylab as pl\r\nfrom sklearn import manifold\r\nfrom sklearn.decomposition import PCA\r\n\r\nimport ot"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "Smacof MDS\r\n ----------\r\n\r\n This function allows to find an embedding of points given a dissimilarity matrix\r\n that will be given by the output of the algorithm\r\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "def smacof_mds(C, dim, max_iter=3000, eps=1e-9):\r\n \"\"\"\r\n Returns an interpolated point cloud following the dissimilarity matrix C\r\n using SMACOF multidimensional scaling (MDS) in specific dimensionned\r\n target space\r\n\r\n Parameters\r\n ----------\r\n C : ndarray, shape (ns, ns)\r\n dissimilarity matrix\r\n dim : int\r\n dimension of the targeted space\r\n max_iter : int\r\n Maximum number of iterations of the SMACOF algorithm for a single run\r\n eps : float\r\n relative tolerance w.r.t stress to declare converge\r\n\r\n Returns\r\n -------\r\n npos : ndarray, shape (R, dim)\r\n Embedded coordinates of the interpolated point cloud (defined with\r\n one isometry)\r\n \"\"\"\r\n\r\n rng = np.random.RandomState(seed=3)\r\n\r\n mds = manifold.MDS(\r\n dim,\r\n max_iter=max_iter,\r\n eps=1e-9,\r\n dissimilarity='precomputed',\r\n n_init=1)\r\n pos = mds.fit(C).embedding_\r\n\r\n nmds = manifold.MDS(\r\n 2,\r\n max_iter=max_iter,\r\n eps=1e-9,\r\n dissimilarity=\"precomputed\",\r\n random_state=rng,\r\n n_init=1)\r\n npos = nmds.fit_transform(C, init=pos)\r\n\r\n return npos"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "Data preparation\r\n ----------------\r\n\r\n The four distributions are constructed from 4 simple images\r\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "def im2mat(I):\r\n \"\"\"Converts and image to matrix (one pixel per line)\"\"\"\r\n return I.reshape((I.shape[0] * I.shape[1], I.shape[2]))\r\n\r\n\r\nsquare = spi.imread('../data/square.png').astype(np.float64)[:, :, 2] / 256\r\ncross = spi.imread('../data/cross.png').astype(np.float64)[:, :, 2] / 256\r\ntriangle = spi.imread('../data/triangle.png').astype(np.float64)[:, :, 2] / 256\r\nstar = spi.imread('../data/star.png').astype(np.float64)[:, :, 2] / 256\r\n\r\nshapes = [square, cross, triangle, star]\r\n\r\nS = 4\r\nxs = [[] for i in range(S)]\r\n\r\n\r\nfor nb in range(4):\r\n for i in range(8):\r\n for j in range(8):\r\n if shapes[nb][i, j] < 0.95:\r\n xs[nb].append([j, 8 - i])\r\n\r\nxs = np.array([np.array(xs[0]), np.array(xs[1]),\r\n np.array(xs[2]), np.array(xs[3])])"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "Barycenter computation\r\n----------------------\r\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "ns = [len(xs[s]) for s in range(S)]\r\nn_samples = 30\r\n\r\n\"\"\"Compute all distances matrices for the four shapes\"\"\"\r\nCs = [sp.spatial.distance.cdist(xs[s], xs[s]) for s in range(S)]\r\nCs = [cs / cs.max() for cs in Cs]\r\n\r\nps = [ot.unif(ns[s]) for s in range(S)]\r\np = ot.unif(n_samples)\r\n\r\n\r\nlambdast = [[float(i) / 3, float(3 - i) / 3] for i in [1, 2]]\r\n\r\nCt01 = [0 for i in range(2)]\r\nfor i in range(2):\r\n Ct01[i] = ot.gromov.gromov_barycenters(n_samples, [Cs[0], Cs[1]],\r\n [ps[0], ps[1]\r\n ], p, lambdast[i], 'square_loss', 5e-4,\r\n max_iter=100, tol=1e-3)\r\n\r\nCt02 = [0 for i in range(2)]\r\nfor i in range(2):\r\n Ct02[i] = ot.gromov.gromov_barycenters(n_samples, [Cs[0], Cs[2]],\r\n [ps[0], ps[2]\r\n ], p, lambdast[i], 'square_loss', 5e-4,\r\n max_iter=100, tol=1e-3)\r\n\r\nCt13 = [0 for i in range(2)]\r\nfor i in range(2):\r\n Ct13[i] = ot.gromov.gromov_barycenters(n_samples, [Cs[1], Cs[3]],\r\n [ps[1], ps[3]\r\n ], p, lambdast[i], 'square_loss', 5e-4,\r\n max_iter=100, tol=1e-3)\r\n\r\nCt23 = [0 for i in range(2)]\r\nfor i in range(2):\r\n Ct23[i] = ot.gromov.gromov_barycenters(n_samples, [Cs[2], Cs[3]],\r\n [ps[2], ps[3]\r\n ], p, lambdast[i], 'square_loss', 5e-4,\r\n max_iter=100, tol=1e-3)"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "Visualization\r\n -------------\r\n\r\n The PCA helps in getting consistency between the rotations\r\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "clf = PCA(n_components=2)\r\nnpos = [0, 0, 0, 0]\r\nnpos = [smacof_mds(Cs[s], 2) for s in range(S)]\r\n\r\nnpost01 = [0, 0]\r\nnpost01 = [smacof_mds(Ct01[s], 2) for s in range(2)]\r\nnpost01 = [clf.fit_transform(npost01[s]) for s in range(2)]\r\n\r\nnpost02 = [0, 0]\r\nnpost02 = [smacof_mds(Ct02[s], 2) for s in range(2)]\r\nnpost02 = [clf.fit_transform(npost02[s]) for s in range(2)]\r\n\r\nnpost13 = [0, 0]\r\nnpost13 = [smacof_mds(Ct13[s], 2) for s in range(2)]\r\nnpost13 = [clf.fit_transform(npost13[s]) for s in range(2)]\r\n\r\nnpost23 = [0, 0]\r\nnpost23 = [smacof_mds(Ct23[s], 2) for s in range(2)]\r\nnpost23 = [clf.fit_transform(npost23[s]) for s in range(2)]\r\n\r\n\r\nfig = pl.figure(figsize=(10, 10))\r\n\r\nax1 = pl.subplot2grid((4, 4), (0, 0))\r\npl.xlim((-1, 1))\r\npl.ylim((-1, 1))\r\nax1.scatter(npos[0][:, 0], npos[0][:, 1], color='r')\r\n\r\nax2 = pl.subplot2grid((4, 4), (0, 1))\r\npl.xlim((-1, 1))\r\npl.ylim((-1, 1))\r\nax2.scatter(npost01[1][:, 0], npost01[1][:, 1], color='b')\r\n\r\nax3 = pl.subplot2grid((4, 4), (0, 2))\r\npl.xlim((-1, 1))\r\npl.ylim((-1, 1))\r\nax3.scatter(npost01[0][:, 0], npost01[0][:, 1], color='b')\r\n\r\nax4 = pl.subplot2grid((4, 4), (0, 3))\r\npl.xlim((-1, 1))\r\npl.ylim((-1, 1))\r\nax4.scatter(npos[1][:, 0], npos[1][:, 1], color='r')\r\n\r\nax5 = pl.subplot2grid((4, 4), (1, 0))\r\npl.xlim((-1, 1))\r\npl.ylim((-1, 1))\r\nax5.scatter(npost02[1][:, 0], npost02[1][:, 1], color='b')\r\n\r\nax6 = pl.subplot2grid((4, 4), (1, 3))\r\npl.xlim((-1, 1))\r\npl.ylim((-1, 1))\r\nax6.scatter(npost13[1][:, 0], npost13[1][:, 1], color='b')\r\n\r\nax7 = pl.subplot2grid((4, 4), (2, 0))\r\npl.xlim((-1, 1))\r\npl.ylim((-1, 1))\r\nax7.scatter(npost02[0][:, 0], npost02[0][:, 1], color='b')\r\n\r\nax8 = pl.subplot2grid((4, 4), (2, 3))\r\npl.xlim((-1, 1))\r\npl.ylim((-1, 1))\r\nax8.scatter(npost13[0][:, 0], npost13[0][:, 1], color='b')\r\n\r\nax9 = pl.subplot2grid((4, 4), (3, 0))\r\npl.xlim((-1, 1))\r\npl.ylim((-1, 1))\r\nax9.scatter(npos[2][:, 0], npos[2][:, 1], color='r')\r\n\r\nax10 = pl.subplot2grid((4, 4), (3, 1))\r\npl.xlim((-1, 1))\r\npl.ylim((-1, 1))\r\nax10.scatter(npost23[1][:, 0], npost23[1][:, 1], color='b')\r\n\r\nax11 = pl.subplot2grid((4, 4), (3, 2))\r\npl.xlim((-1, 1))\r\npl.ylim((-1, 1))\r\nax11.scatter(npost23[0][:, 0], npost23[0][:, 1], color='b')\r\n\r\nax12 = pl.subplot2grid((4, 4), (3, 3))\r\npl.xlim((-1, 1))\r\npl.ylim((-1, 1))\r\nax12.scatter(npos[3][:, 0], npos[3][:, 1], color='r')"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "name": "python2",
+ "language": "python"
+ },
+ "language_info": {
+ "mimetype": "text/x-python",
+ "nbconvert_exporter": "python",
+ "name": "python",
+ "file_extension": ".py",
+ "version": "2.7.12",
+ "pygments_lexer": "ipython2",
+ "codemirror_mode": {
+ "version": 2,
+ "name": "ipython"
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/docs/source/auto_examples/plot_gromov_barycenter.py b/docs/source/auto_examples/plot_gromov_barycenter.py
new file mode 100644
index 0000000..180b0cf
--- /dev/null
+++ b/docs/source/auto_examples/plot_gromov_barycenter.py
@@ -0,0 +1,248 @@
+# -*- coding: utf-8 -*-
+"""
+=====================================
+Gromov-Wasserstein Barycenter example
+=====================================
+
+This example is designed to show how to use the Gromov-Wasserstein distance
+computation in POT.
+"""
+
+# Author: Erwan Vautier <erwan.vautier@gmail.com>
+# Nicolas Courty <ncourty@irisa.fr>
+#
+# License: MIT License
+
+
+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
+
+import ot
+
+##############################################################################
+# Smacof MDS
+# ----------
+#
+# This function allows to find an embedding of points given a dissimilarity matrix
+# that will be given by the output of the algorithm
+
+
+def smacof_mds(C, dim, max_iter=3000, eps=1e-9):
+ """
+ Returns an interpolated point cloud following the dissimilarity matrix C
+ using SMACOF multidimensional scaling (MDS) in specific dimensionned
+ target space
+
+ Parameters
+ ----------
+ C : ndarray, shape (ns, ns)
+ dissimilarity matrix
+ dim : int
+ dimension of the targeted space
+ max_iter : int
+ Maximum number of iterations of the SMACOF algorithm for a single run
+ eps : float
+ relative tolerance w.r.t stress to declare converge
+
+ Returns
+ -------
+ npos : ndarray, shape (R, dim)
+ Embedded coordinates of the interpolated point cloud (defined with
+ one isometry)
+ """
+
+ rng = np.random.RandomState(seed=3)
+
+ mds = manifold.MDS(
+ dim,
+ max_iter=max_iter,
+ eps=1e-9,
+ dissimilarity='precomputed',
+ n_init=1)
+ pos = mds.fit(C).embedding_
+
+ nmds = manifold.MDS(
+ 2,
+ max_iter=max_iter,
+ eps=1e-9,
+ dissimilarity="precomputed",
+ random_state=rng,
+ n_init=1)
+ npos = nmds.fit_transform(C, init=pos)
+
+ return npos
+
+
+##############################################################################
+# Data preparation
+# ----------------
+#
+# The four distributions are constructed from 4 simple images
+
+
+def im2mat(I):
+ """Converts and image to matrix (one pixel per line)"""
+ 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
+
+shapes = [square, cross, triangle, star]
+
+S = 4
+xs = [[] for i in range(S)]
+
+
+for nb in range(4):
+ for i in range(8):
+ for j in range(8):
+ if shapes[nb][i, j] < 0.95:
+ xs[nb].append([j, 8 - i])
+
+xs = np.array([np.array(xs[0]), np.array(xs[1]),
+ np.array(xs[2]), np.array(xs[3])])
+
+##############################################################################
+# Barycenter computation
+# ----------------------
+
+
+ns = [len(xs[s]) for s in range(S)]
+n_samples = 30
+
+"""Compute all distances matrices for the four shapes"""
+Cs = [sp.spatial.distance.cdist(xs[s], xs[s]) for s in range(S)]
+Cs = [cs / cs.max() for cs in Cs]
+
+ps = [ot.unif(ns[s]) for s in range(S)]
+p = ot.unif(n_samples)
+
+
+lambdast = [[float(i) / 3, float(3 - i) / 3] for i in [1, 2]]
+
+Ct01 = [0 for i in range(2)]
+for i in range(2):
+ Ct01[i] = ot.gromov.gromov_barycenters(n_samples, [Cs[0], Cs[1]],
+ [ps[0], ps[1]
+ ], p, lambdast[i], 'square_loss', 5e-4,
+ max_iter=100, tol=1e-3)
+
+Ct02 = [0 for i in range(2)]
+for i in range(2):
+ Ct02[i] = ot.gromov.gromov_barycenters(n_samples, [Cs[0], Cs[2]],
+ [ps[0], ps[2]
+ ], p, lambdast[i], 'square_loss', 5e-4,
+ max_iter=100, tol=1e-3)
+
+Ct13 = [0 for i in range(2)]
+for i in range(2):
+ Ct13[i] = ot.gromov.gromov_barycenters(n_samples, [Cs[1], Cs[3]],
+ [ps[1], ps[3]
+ ], p, lambdast[i], 'square_loss', 5e-4,
+ max_iter=100, tol=1e-3)
+
+Ct23 = [0 for i in range(2)]
+for i in range(2):
+ Ct23[i] = ot.gromov.gromov_barycenters(n_samples, [Cs[2], Cs[3]],
+ [ps[2], ps[3]
+ ], p, lambdast[i], 'square_loss', 5e-4,
+ max_iter=100, tol=1e-3)
+
+
+##############################################################################
+# Visualization
+# -------------
+#
+# The PCA helps in getting consistency between the rotations
+
+
+clf = PCA(n_components=2)
+npos = [0, 0, 0, 0]
+npos = [smacof_mds(Cs[s], 2) for s in range(S)]
+
+npost01 = [0, 0]
+npost01 = [smacof_mds(Ct01[s], 2) for s in range(2)]
+npost01 = [clf.fit_transform(npost01[s]) for s in range(2)]
+
+npost02 = [0, 0]
+npost02 = [smacof_mds(Ct02[s], 2) for s in range(2)]
+npost02 = [clf.fit_transform(npost02[s]) for s in range(2)]
+
+npost13 = [0, 0]
+npost13 = [smacof_mds(Ct13[s], 2) for s in range(2)]
+npost13 = [clf.fit_transform(npost13[s]) for s in range(2)]
+
+npost23 = [0, 0]
+npost23 = [smacof_mds(Ct23[s], 2) for s in range(2)]
+npost23 = [clf.fit_transform(npost23[s]) for s in range(2)]
+
+
+fig = pl.figure(figsize=(10, 10))
+
+ax1 = pl.subplot2grid((4, 4), (0, 0))
+pl.xlim((-1, 1))
+pl.ylim((-1, 1))
+ax1.scatter(npos[0][:, 0], npos[0][:, 1], color='r')
+
+ax2 = pl.subplot2grid((4, 4), (0, 1))
+pl.xlim((-1, 1))
+pl.ylim((-1, 1))
+ax2.scatter(npost01[1][:, 0], npost01[1][:, 1], color='b')
+
+ax3 = pl.subplot2grid((4, 4), (0, 2))
+pl.xlim((-1, 1))
+pl.ylim((-1, 1))
+ax3.scatter(npost01[0][:, 0], npost01[0][:, 1], color='b')
+
+ax4 = pl.subplot2grid((4, 4), (0, 3))
+pl.xlim((-1, 1))
+pl.ylim((-1, 1))
+ax4.scatter(npos[1][:, 0], npos[1][:, 1], color='r')
+
+ax5 = pl.subplot2grid((4, 4), (1, 0))
+pl.xlim((-1, 1))
+pl.ylim((-1, 1))
+ax5.scatter(npost02[1][:, 0], npost02[1][:, 1], color='b')
+
+ax6 = pl.subplot2grid((4, 4), (1, 3))
+pl.xlim((-1, 1))
+pl.ylim((-1, 1))
+ax6.scatter(npost13[1][:, 0], npost13[1][:, 1], color='b')
+
+ax7 = pl.subplot2grid((4, 4), (2, 0))
+pl.xlim((-1, 1))
+pl.ylim((-1, 1))
+ax7.scatter(npost02[0][:, 0], npost02[0][:, 1], color='b')
+
+ax8 = pl.subplot2grid((4, 4), (2, 3))
+pl.xlim((-1, 1))
+pl.ylim((-1, 1))
+ax8.scatter(npost13[0][:, 0], npost13[0][:, 1], color='b')
+
+ax9 = pl.subplot2grid((4, 4), (3, 0))
+pl.xlim((-1, 1))
+pl.ylim((-1, 1))
+ax9.scatter(npos[2][:, 0], npos[2][:, 1], color='r')
+
+ax10 = pl.subplot2grid((4, 4), (3, 1))
+pl.xlim((-1, 1))
+pl.ylim((-1, 1))
+ax10.scatter(npost23[1][:, 0], npost23[1][:, 1], color='b')
+
+ax11 = pl.subplot2grid((4, 4), (3, 2))
+pl.xlim((-1, 1))
+pl.ylim((-1, 1))
+ax11.scatter(npost23[0][:, 0], npost23[0][:, 1], color='b')
+
+ax12 = pl.subplot2grid((4, 4), (3, 3))
+pl.xlim((-1, 1))
+pl.ylim((-1, 1))
+ax12.scatter(npos[3][:, 0], npos[3][:, 1], color='r')
diff --git a/docs/source/auto_examples/plot_gromov_barycenter.rst b/docs/source/auto_examples/plot_gromov_barycenter.rst
new file mode 100644
index 0000000..ca2d4e9
--- /dev/null
+++ b/docs/source/auto_examples/plot_gromov_barycenter.rst
@@ -0,0 +1,324 @@
+
+
+.. _sphx_glr_auto_examples_plot_gromov_barycenter.py:
+
+
+=====================================
+Gromov-Wasserstein Barycenter example
+=====================================
+
+This example is designed to show how to use the Gromov-Wasserstein distance
+computation in POT.
+
+
+
+.. code-block:: python
+
+
+ # Author: Erwan Vautier <erwan.vautier@gmail.com>
+ # Nicolas Courty <ncourty@irisa.fr>
+ #
+ # License: MIT License
+
+
+ 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
+
+ import ot
+
+
+
+
+
+
+
+Smacof MDS
+ ----------
+
+ 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
+
+
+
+ def smacof_mds(C, dim, max_iter=3000, eps=1e-9):
+ """
+ Returns an interpolated point cloud following the dissimilarity matrix C
+ using SMACOF multidimensional scaling (MDS) in specific dimensionned
+ target space
+
+ Parameters
+ ----------
+ C : ndarray, shape (ns, ns)
+ dissimilarity matrix
+ dim : int
+ dimension of the targeted space
+ max_iter : int
+ Maximum number of iterations of the SMACOF algorithm for a single run
+ eps : float
+ relative tolerance w.r.t stress to declare converge
+
+ Returns
+ -------
+ npos : ndarray, shape (R, dim)
+ Embedded coordinates of the interpolated point cloud (defined with
+ one isometry)
+ """
+
+ rng = np.random.RandomState(seed=3)
+
+ mds = manifold.MDS(
+ dim,
+ max_iter=max_iter,
+ eps=1e-9,
+ dissimilarity='precomputed',
+ n_init=1)
+ pos = mds.fit(C).embedding_
+
+ nmds = manifold.MDS(
+ 2,
+ max_iter=max_iter,
+ eps=1e-9,
+ dissimilarity="precomputed",
+ random_state=rng,
+ n_init=1)
+ npos = nmds.fit_transform(C, init=pos)
+
+ return npos
+
+
+
+
+
+
+
+
+Data preparation
+ ----------------
+
+ The four distributions are constructed from 4 simple images
+
+
+
+.. code-block:: python
+
+
+
+ def im2mat(I):
+ """Converts and image to matrix (one pixel per line)"""
+ 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
+
+ shapes = [square, cross, triangle, star]
+
+ S = 4
+ xs = [[] for i in range(S)]
+
+
+ for nb in range(4):
+ for i in range(8):
+ for j in range(8):
+ if shapes[nb][i, j] < 0.95:
+ xs[nb].append([j, 8 - i])
+
+ xs = np.array([np.array(xs[0]), np.array(xs[1]),
+ np.array(xs[2]), np.array(xs[3])])
+
+
+
+
+
+
+
+Barycenter computation
+----------------------
+
+
+
+.. code-block:: python
+
+
+
+ ns = [len(xs[s]) for s in range(S)]
+ n_samples = 30
+
+ """Compute all distances matrices for the four shapes"""
+ Cs = [sp.spatial.distance.cdist(xs[s], xs[s]) for s in range(S)]
+ Cs = [cs / cs.max() for cs in Cs]
+
+ ps = [ot.unif(ns[s]) for s in range(S)]
+ p = ot.unif(n_samples)
+
+
+ lambdast = [[float(i) / 3, float(3 - i) / 3] for i in [1, 2]]
+
+ Ct01 = [0 for i in range(2)]
+ for i in range(2):
+ Ct01[i] = ot.gromov.gromov_barycenters(n_samples, [Cs[0], Cs[1]],
+ [ps[0], ps[1]
+ ], p, lambdast[i], 'square_loss', 5e-4,
+ max_iter=100, tol=1e-3)
+
+ Ct02 = [0 for i in range(2)]
+ for i in range(2):
+ Ct02[i] = ot.gromov.gromov_barycenters(n_samples, [Cs[0], Cs[2]],
+ [ps[0], ps[2]
+ ], p, lambdast[i], 'square_loss', 5e-4,
+ max_iter=100, tol=1e-3)
+
+ Ct13 = [0 for i in range(2)]
+ for i in range(2):
+ Ct13[i] = ot.gromov.gromov_barycenters(n_samples, [Cs[1], Cs[3]],
+ [ps[1], ps[3]
+ ], p, lambdast[i], 'square_loss', 5e-4,
+ max_iter=100, tol=1e-3)
+
+ Ct23 = [0 for i in range(2)]
+ for i in range(2):
+ Ct23[i] = ot.gromov.gromov_barycenters(n_samples, [Cs[2], Cs[3]],
+ [ps[2], ps[3]
+ ], p, lambdast[i], 'square_loss', 5e-4,
+ max_iter=100, tol=1e-3)
+
+
+
+
+
+
+
+
+Visualization
+ -------------
+
+ The PCA helps in getting consistency between the rotations
+
+
+
+.. code-block:: python
+
+
+
+ clf = PCA(n_components=2)
+ npos = [0, 0, 0, 0]
+ npos = [smacof_mds(Cs[s], 2) for s in range(S)]
+
+ npost01 = [0, 0]
+ npost01 = [smacof_mds(Ct01[s], 2) for s in range(2)]
+ npost01 = [clf.fit_transform(npost01[s]) for s in range(2)]
+
+ npost02 = [0, 0]
+ npost02 = [smacof_mds(Ct02[s], 2) for s in range(2)]
+ npost02 = [clf.fit_transform(npost02[s]) for s in range(2)]
+
+ npost13 = [0, 0]
+ npost13 = [smacof_mds(Ct13[s], 2) for s in range(2)]
+ npost13 = [clf.fit_transform(npost13[s]) for s in range(2)]
+
+ npost23 = [0, 0]
+ npost23 = [smacof_mds(Ct23[s], 2) for s in range(2)]
+ npost23 = [clf.fit_transform(npost23[s]) for s in range(2)]
+
+
+ fig = pl.figure(figsize=(10, 10))
+
+ ax1 = pl.subplot2grid((4, 4), (0, 0))
+ pl.xlim((-1, 1))
+ pl.ylim((-1, 1))
+ ax1.scatter(npos[0][:, 0], npos[0][:, 1], color='r')
+
+ ax2 = pl.subplot2grid((4, 4), (0, 1))
+ pl.xlim((-1, 1))
+ pl.ylim((-1, 1))
+ ax2.scatter(npost01[1][:, 0], npost01[1][:, 1], color='b')
+
+ ax3 = pl.subplot2grid((4, 4), (0, 2))
+ pl.xlim((-1, 1))
+ pl.ylim((-1, 1))
+ ax3.scatter(npost01[0][:, 0], npost01[0][:, 1], color='b')
+
+ ax4 = pl.subplot2grid((4, 4), (0, 3))
+ pl.xlim((-1, 1))
+ pl.ylim((-1, 1))
+ ax4.scatter(npos[1][:, 0], npos[1][:, 1], color='r')
+
+ ax5 = pl.subplot2grid((4, 4), (1, 0))
+ pl.xlim((-1, 1))
+ pl.ylim((-1, 1))
+ ax5.scatter(npost02[1][:, 0], npost02[1][:, 1], color='b')
+
+ ax6 = pl.subplot2grid((4, 4), (1, 3))
+ pl.xlim((-1, 1))
+ pl.ylim((-1, 1))
+ ax6.scatter(npost13[1][:, 0], npost13[1][:, 1], color='b')
+
+ ax7 = pl.subplot2grid((4, 4), (2, 0))
+ pl.xlim((-1, 1))
+ pl.ylim((-1, 1))
+ ax7.scatter(npost02[0][:, 0], npost02[0][:, 1], color='b')
+
+ ax8 = pl.subplot2grid((4, 4), (2, 3))
+ pl.xlim((-1, 1))
+ pl.ylim((-1, 1))
+ ax8.scatter(npost13[0][:, 0], npost13[0][:, 1], color='b')
+
+ ax9 = pl.subplot2grid((4, 4), (3, 0))
+ pl.xlim((-1, 1))
+ pl.ylim((-1, 1))
+ ax9.scatter(npos[2][:, 0], npos[2][:, 1], color='r')
+
+ ax10 = pl.subplot2grid((4, 4), (3, 1))
+ pl.xlim((-1, 1))
+ pl.ylim((-1, 1))
+ ax10.scatter(npost23[1][:, 0], npost23[1][:, 1], color='b')
+
+ ax11 = pl.subplot2grid((4, 4), (3, 2))
+ pl.xlim((-1, 1))
+ pl.ylim((-1, 1))
+ ax11.scatter(npost23[0][:, 0], npost23[0][:, 1], color='b')
+
+ ax12 = pl.subplot2grid((4, 4), (3, 3))
+ pl.xlim((-1, 1))
+ pl.ylim((-1, 1))
+ ax12.scatter(npos[3][:, 0], npos[3][:, 1], color='r')
+
+
+
+.. image:: /auto_examples/images/sphx_glr_plot_gromov_barycenter_001.png
+ :align: center
+
+
+
+
+**Total running time of the script:** ( 8 minutes 43.875 seconds)
+
+
+
+.. container:: sphx-glr-footer
+
+
+ .. container:: sphx-glr-download
+
+ :download:`Download Python source code: plot_gromov_barycenter.py <plot_gromov_barycenter.py>`
+
+
+
+ .. container:: sphx-glr-download
+
+ :download:`Download Jupyter notebook: plot_gromov_barycenter.ipynb <plot_gromov_barycenter.ipynb>`
+
+.. rst-class:: sphx-glr-signature
+
+ `Generated by Sphinx-Gallery <http://sphinx-gallery.readthedocs.io>`_
diff --git a/docs/source/auto_examples/plot_optim_OTreg.rst b/docs/source/auto_examples/plot_optim_OTreg.rst
index f628024..480149a 100644
--- a/docs/source/auto_examples/plot_optim_OTreg.rst
+++ b/docs/source/auto_examples/plot_optim_OTreg.rst
@@ -399,225 +399,194 @@ Solve EMD with entropic regularization
--------------------------------
0|1.692289e-01|0.000000e+00
1|1.617643e-01|-4.614437e-02
- 2|1.612546e-01|-3.161037e-03
- 3|1.611040e-01|-9.349544e-04
- 4|1.610346e-01|-4.310179e-04
- 5|1.610072e-01|-1.701719e-04
- 6|1.609947e-01|-7.759814e-05
- 7|1.609934e-01|-7.941439e-06
- 8|1.609841e-01|-5.797180e-05
- 9|1.609838e-01|-1.559407e-06
- 10|1.609685e-01|-9.530282e-05
- 11|1.609666e-01|-1.142129e-05
- 12|1.609541e-01|-7.799970e-05
- 13|1.609496e-01|-2.780416e-05
- 14|1.609385e-01|-6.887105e-05
- 15|1.609334e-01|-3.174241e-05
- 16|1.609231e-01|-6.420777e-05
- 17|1.609115e-01|-7.189949e-05
- 18|1.608815e-01|-1.865331e-04
- 19|1.608799e-01|-1.013039e-05
+ 2|1.612639e-01|-3.102965e-03
+ 3|1.611291e-01|-8.371098e-04
+ 4|1.610468e-01|-5.110558e-04
+ 5|1.610198e-01|-1.672927e-04
+ 6|1.610130e-01|-4.232417e-05
+ 7|1.610090e-01|-2.513455e-05
+ 8|1.610002e-01|-5.443507e-05
+ 9|1.609996e-01|-3.657071e-06
+ 10|1.609948e-01|-2.998735e-05
+ 11|1.609695e-01|-1.569217e-04
+ 12|1.609533e-01|-1.010779e-04
+ 13|1.609520e-01|-8.043897e-06
+ 14|1.609465e-01|-3.415246e-05
+ 15|1.609386e-01|-4.898605e-05
+ 16|1.609324e-01|-3.837052e-05
+ 17|1.609298e-01|-1.617826e-05
+ 18|1.609184e-01|-7.080015e-05
+ 19|1.609083e-01|-6.273206e-05
It. |Loss |Delta loss
--------------------------------
- 20|1.608695e-01|-6.468606e-05
- 21|1.608686e-01|-5.738419e-06
- 22|1.608661e-01|-1.495923e-05
- 23|1.608657e-01|-2.784611e-06
- 24|1.608633e-01|-1.512408e-05
- 25|1.608624e-01|-5.397916e-06
- 26|1.608617e-01|-4.115218e-06
- 27|1.608561e-01|-3.503396e-05
- 28|1.608479e-01|-5.098773e-05
- 29|1.608452e-01|-1.659203e-05
- 30|1.608399e-01|-3.298319e-05
- 31|1.608330e-01|-4.302183e-05
- 32|1.608310e-01|-1.273465e-05
- 33|1.608280e-01|-1.827713e-05
- 34|1.608231e-01|-3.039842e-05
- 35|1.608212e-01|-1.229256e-05
- 36|1.608200e-01|-6.900556e-06
- 37|1.608159e-01|-2.554039e-05
- 38|1.608103e-01|-3.521137e-05
- 39|1.608058e-01|-2.795180e-05
+ 20|1.608988e-01|-5.940805e-05
+ 21|1.608853e-01|-8.380030e-05
+ 22|1.608844e-01|-5.185045e-06
+ 23|1.608824e-01|-1.279113e-05
+ 24|1.608819e-01|-3.156821e-06
+ 25|1.608783e-01|-2.205746e-05
+ 26|1.608764e-01|-1.189894e-05
+ 27|1.608755e-01|-5.474607e-06
+ 28|1.608737e-01|-1.144227e-05
+ 29|1.608676e-01|-3.775335e-05
+ 30|1.608638e-01|-2.348020e-05
+ 31|1.608627e-01|-6.863136e-06
+ 32|1.608529e-01|-6.110230e-05
+ 33|1.608487e-01|-2.641106e-05
+ 34|1.608409e-01|-4.823638e-05
+ 35|1.608373e-01|-2.256641e-05
+ 36|1.608338e-01|-2.132444e-05
+ 37|1.608310e-01|-1.786649e-05
+ 38|1.608260e-01|-3.103848e-05
+ 39|1.608206e-01|-3.321265e-05
It. |Loss |Delta loss
--------------------------------
- 40|1.608040e-01|-1.119118e-05
- 41|1.608027e-01|-8.193369e-06
- 42|1.607994e-01|-2.026719e-05
- 43|1.607985e-01|-5.819902e-06
- 44|1.607978e-01|-4.048170e-06
- 45|1.607978e-01|-3.007470e-07
- 46|1.607950e-01|-1.705375e-05
- 47|1.607927e-01|-1.430186e-05
- 48|1.607925e-01|-1.166526e-06
- 49|1.607911e-01|-9.069406e-06
- 50|1.607910e-01|-3.804209e-07
- 51|1.607910e-01|-5.942399e-08
- 52|1.607910e-01|-2.321380e-07
- 53|1.607907e-01|-1.877655e-06
- 54|1.607906e-01|-2.940224e-07
- 55|1.607877e-01|-1.814208e-05
- 56|1.607841e-01|-2.236496e-05
- 57|1.607810e-01|-1.951355e-05
- 58|1.607804e-01|-3.578228e-06
- 59|1.607789e-01|-9.442277e-06
+ 40|1.608201e-01|-3.054747e-06
+ 41|1.608195e-01|-4.198335e-06
+ 42|1.608193e-01|-8.458736e-07
+ 43|1.608159e-01|-2.153759e-05
+ 44|1.608115e-01|-2.738314e-05
+ 45|1.608108e-01|-3.960032e-06
+ 46|1.608081e-01|-1.675447e-05
+ 47|1.608072e-01|-5.976340e-06
+ 48|1.608046e-01|-1.604130e-05
+ 49|1.608020e-01|-1.617036e-05
+ 50|1.608014e-01|-3.957795e-06
+ 51|1.608011e-01|-1.292411e-06
+ 52|1.607998e-01|-8.431795e-06
+ 53|1.607964e-01|-2.127054e-05
+ 54|1.607947e-01|-1.021878e-05
+ 55|1.607947e-01|-3.560621e-07
+ 56|1.607900e-01|-2.929781e-05
+ 57|1.607890e-01|-5.740229e-06
+ 58|1.607858e-01|-2.039550e-05
+ 59|1.607836e-01|-1.319545e-05
It. |Loss |Delta loss
--------------------------------
- 60|1.607779e-01|-5.997371e-06
- 61|1.607754e-01|-1.564408e-05
- 62|1.607742e-01|-7.693285e-06
- 63|1.607727e-01|-9.030547e-06
- 64|1.607719e-01|-5.103894e-06
- 65|1.607693e-01|-1.605420e-05
- 66|1.607676e-01|-1.047837e-05
- 67|1.607675e-01|-6.026848e-07
- 68|1.607655e-01|-1.240216e-05
- 69|1.607632e-01|-1.434674e-05
- 70|1.607618e-01|-8.829808e-06
- 71|1.607606e-01|-7.581824e-06
- 72|1.607590e-01|-1.009457e-05
- 73|1.607586e-01|-2.222963e-06
- 74|1.607577e-01|-5.564775e-06
- 75|1.607574e-01|-1.932763e-06
- 76|1.607573e-01|-8.148685e-07
- 77|1.607554e-01|-1.187660e-05
- 78|1.607546e-01|-4.557651e-06
- 79|1.607537e-01|-5.911902e-06
+ 60|1.607826e-01|-6.378947e-06
+ 61|1.607808e-01|-1.145102e-05
+ 62|1.607776e-01|-1.941743e-05
+ 63|1.607743e-01|-2.087422e-05
+ 64|1.607741e-01|-1.310249e-06
+ 65|1.607738e-01|-1.682752e-06
+ 66|1.607691e-01|-2.913936e-05
+ 67|1.607671e-01|-1.288855e-05
+ 68|1.607654e-01|-1.002448e-05
+ 69|1.607641e-01|-8.209492e-06
+ 70|1.607632e-01|-5.588467e-06
+ 71|1.607619e-01|-8.050388e-06
+ 72|1.607618e-01|-9.417493e-07
+ 73|1.607598e-01|-1.210509e-05
+ 74|1.607591e-01|-4.392914e-06
+ 75|1.607579e-01|-7.759587e-06
+ 76|1.607574e-01|-2.760280e-06
+ 77|1.607556e-01|-1.146469e-05
+ 78|1.607550e-01|-3.689456e-06
+ 79|1.607550e-01|-4.065631e-08
It. |Loss |Delta loss
--------------------------------
- 80|1.607529e-01|-4.710187e-06
- 81|1.607528e-01|-8.866080e-07
- 82|1.607522e-01|-3.620627e-06
- 83|1.607514e-01|-5.091281e-06
- 84|1.607498e-01|-9.932095e-06
- 85|1.607487e-01|-6.852804e-06
- 86|1.607478e-01|-5.373596e-06
- 87|1.607473e-01|-3.287295e-06
- 88|1.607470e-01|-1.666655e-06
- 89|1.607469e-01|-5.293790e-07
- 90|1.607466e-01|-2.051914e-06
- 91|1.607456e-01|-6.422797e-06
- 92|1.607456e-01|-1.110433e-07
- 93|1.607451e-01|-2.803849e-06
- 94|1.607451e-01|-2.608066e-07
- 95|1.607441e-01|-6.290352e-06
- 96|1.607429e-01|-7.298455e-06
- 97|1.607429e-01|-8.969905e-09
- 98|1.607427e-01|-7.923968e-07
- 99|1.607427e-01|-3.519286e-07
+ 80|1.607539e-01|-6.555681e-06
+ 81|1.607528e-01|-7.177470e-06
+ 82|1.607527e-01|-5.306068e-07
+ 83|1.607514e-01|-7.816045e-06
+ 84|1.607511e-01|-2.301970e-06
+ 85|1.607504e-01|-4.281072e-06
+ 86|1.607503e-01|-7.821886e-07
+ 87|1.607480e-01|-1.403013e-05
+ 88|1.607480e-01|-1.169298e-08
+ 89|1.607473e-01|-4.235982e-06
+ 90|1.607470e-01|-1.717105e-06
+ 91|1.607470e-01|-6.148402e-09
+ 92|1.607462e-01|-5.396481e-06
+ 93|1.607461e-01|-5.194954e-07
+ 94|1.607450e-01|-6.525707e-06
+ 95|1.607442e-01|-5.332060e-06
+ 96|1.607439e-01|-1.682093e-06
+ 97|1.607437e-01|-1.594796e-06
+ 98|1.607435e-01|-7.923812e-07
+ 99|1.607420e-01|-9.738552e-06
It. |Loss |Delta loss
--------------------------------
- 100|1.607426e-01|-3.563804e-07
- 101|1.607410e-01|-1.004042e-05
- 102|1.607410e-01|-2.124801e-07
- 103|1.607398e-01|-7.556935e-06
- 104|1.607398e-01|-7.606853e-08
- 105|1.607385e-01|-8.058684e-06
- 106|1.607383e-01|-7.393061e-07
- 107|1.607381e-01|-1.504958e-06
- 108|1.607377e-01|-2.508807e-06
- 109|1.607371e-01|-4.004631e-06
- 110|1.607365e-01|-3.580156e-06
- 111|1.607364e-01|-2.563573e-07
- 112|1.607354e-01|-6.390137e-06
- 113|1.607348e-01|-4.119553e-06
- 114|1.607339e-01|-5.299475e-06
- 115|1.607335e-01|-2.316767e-06
- 116|1.607330e-01|-3.444737e-06
- 117|1.607324e-01|-3.467980e-06
- 118|1.607320e-01|-2.374632e-06
- 119|1.607319e-01|-7.978255e-07
+ 100|1.607419e-01|-1.022448e-07
+ 101|1.607419e-01|-4.865999e-07
+ 102|1.607418e-01|-7.092012e-07
+ 103|1.607408e-01|-5.861815e-06
+ 104|1.607402e-01|-3.953266e-06
+ 105|1.607395e-01|-3.969572e-06
+ 106|1.607390e-01|-3.612075e-06
+ 107|1.607377e-01|-7.683735e-06
+ 108|1.607365e-01|-7.777599e-06
+ 109|1.607364e-01|-2.335096e-07
+ 110|1.607364e-01|-4.562036e-07
+ 111|1.607360e-01|-2.089538e-06
+ 112|1.607356e-01|-2.755355e-06
+ 113|1.607349e-01|-4.501960e-06
+ 114|1.607347e-01|-1.160544e-06
+ 115|1.607346e-01|-6.289450e-07
+ 116|1.607345e-01|-2.092146e-07
+ 117|1.607336e-01|-5.990866e-06
+ 118|1.607330e-01|-3.348498e-06
+ 119|1.607328e-01|-1.256222e-06
It. |Loss |Delta loss
--------------------------------
- 120|1.607312e-01|-4.221434e-06
- 121|1.607310e-01|-1.324597e-06
- 122|1.607304e-01|-3.650359e-06
- 123|1.607298e-01|-3.732712e-06
- 124|1.607295e-01|-1.994082e-06
- 125|1.607289e-01|-3.954139e-06
- 126|1.607286e-01|-1.532372e-06
- 127|1.607286e-01|-1.167223e-07
- 128|1.607283e-01|-2.157376e-06
- 129|1.607279e-01|-2.253077e-06
- 130|1.607274e-01|-3.301532e-06
- 131|1.607269e-01|-2.650754e-06
- 132|1.607264e-01|-3.595551e-06
- 133|1.607262e-01|-1.159425e-06
- 134|1.607258e-01|-2.512411e-06
- 135|1.607255e-01|-1.998792e-06
- 136|1.607251e-01|-2.486536e-06
- 137|1.607246e-01|-2.782996e-06
- 138|1.607246e-01|-2.922470e-07
- 139|1.607242e-01|-2.071131e-06
+ 120|1.607320e-01|-5.418353e-06
+ 121|1.607318e-01|-8.296189e-07
+ 122|1.607311e-01|-4.381608e-06
+ 123|1.607310e-01|-8.913901e-07
+ 124|1.607309e-01|-3.808821e-07
+ 125|1.607302e-01|-4.608994e-06
+ 126|1.607294e-01|-5.063777e-06
+ 127|1.607290e-01|-2.532835e-06
+ 128|1.607285e-01|-2.870049e-06
+ 129|1.607284e-01|-4.892812e-07
+ 130|1.607281e-01|-1.760452e-06
+ 131|1.607279e-01|-1.727139e-06
+ 132|1.607275e-01|-2.220706e-06
+ 133|1.607271e-01|-2.516930e-06
+ 134|1.607269e-01|-1.201434e-06
+ 135|1.607269e-01|-2.183459e-09
+ 136|1.607262e-01|-4.223011e-06
+ 137|1.607258e-01|-2.530202e-06
+ 138|1.607258e-01|-1.857260e-07
+ 139|1.607256e-01|-1.401957e-06
It. |Loss |Delta loss
--------------------------------
- 140|1.607237e-01|-3.154193e-06
- 141|1.607235e-01|-1.194962e-06
- 142|1.607232e-01|-2.035251e-06
- 143|1.607232e-01|-6.027855e-08
- 144|1.607229e-01|-1.555696e-06
- 145|1.607228e-01|-1.081740e-06
- 146|1.607225e-01|-1.881070e-06
- 147|1.607224e-01|-4.100096e-07
- 148|1.607223e-01|-7.785200e-07
- 149|1.607222e-01|-2.094072e-07
- 150|1.607220e-01|-1.440814e-06
- 151|1.607217e-01|-1.997794e-06
- 152|1.607214e-01|-2.011022e-06
- 153|1.607212e-01|-8.808854e-07
- 154|1.607211e-01|-7.245877e-07
- 155|1.607207e-01|-2.217159e-06
- 156|1.607201e-01|-3.817891e-06
- 157|1.607200e-01|-7.409600e-07
- 158|1.607198e-01|-1.497698e-06
- 159|1.607195e-01|-1.729666e-06
+ 140|1.607250e-01|-3.242751e-06
+ 141|1.607247e-01|-2.308071e-06
+ 142|1.607247e-01|-4.730700e-08
+ 143|1.607246e-01|-4.240229e-07
+ 144|1.607242e-01|-2.484810e-06
+ 145|1.607238e-01|-2.539206e-06
+ 146|1.607234e-01|-2.535574e-06
+ 147|1.607231e-01|-1.954802e-06
+ 148|1.607228e-01|-1.765447e-06
+ 149|1.607228e-01|-1.620007e-08
+ 150|1.607222e-01|-3.615783e-06
+ 151|1.607222e-01|-8.668516e-08
+ 152|1.607215e-01|-4.000673e-06
+ 153|1.607213e-01|-1.774103e-06
+ 154|1.607213e-01|-6.328834e-09
+ 155|1.607209e-01|-2.418783e-06
+ 156|1.607208e-01|-2.848492e-07
+ 157|1.607207e-01|-8.836043e-07
+ 158|1.607205e-01|-1.192836e-06
+ 159|1.607202e-01|-1.638022e-06
It. |Loss |Delta loss
--------------------------------
- 160|1.607195e-01|-2.115187e-07
- 161|1.607192e-01|-1.643727e-06
- 162|1.607192e-01|-1.712969e-07
- 163|1.607189e-01|-1.805877e-06
- 164|1.607189e-01|-1.209827e-07
- 165|1.607185e-01|-2.060002e-06
- 166|1.607182e-01|-1.961341e-06
- 167|1.607181e-01|-1.020366e-06
- 168|1.607179e-01|-9.760982e-07
- 169|1.607178e-01|-7.219236e-07
- 170|1.607175e-01|-1.837718e-06
- 171|1.607174e-01|-3.337578e-07
- 172|1.607173e-01|-5.298564e-07
- 173|1.607173e-01|-6.864278e-08
- 174|1.607173e-01|-2.008419e-07
- 175|1.607171e-01|-1.375630e-06
- 176|1.607168e-01|-1.911257e-06
- 177|1.607167e-01|-2.709815e-07
- 178|1.607167e-01|-1.390953e-07
- 179|1.607165e-01|-1.199675e-06
- It. |Loss |Delta loss
- --------------------------------
- 180|1.607165e-01|-1.457259e-07
- 181|1.607163e-01|-1.049154e-06
- 182|1.607163e-01|-2.753577e-09
- 183|1.607163e-01|-6.972814e-09
- 184|1.607161e-01|-1.552100e-06
- 185|1.607159e-01|-1.068596e-06
- 186|1.607157e-01|-1.247724e-06
- 187|1.607155e-01|-1.158164e-06
- 188|1.607155e-01|-2.616199e-07
- 189|1.607154e-01|-3.595874e-07
- 190|1.607154e-01|-5.334527e-08
- 191|1.607153e-01|-3.452744e-07
- 192|1.607153e-01|-1.239593e-07
- 193|1.607152e-01|-8.184984e-07
- 194|1.607150e-01|-1.316308e-06
- 195|1.607150e-01|-7.100882e-09
- 196|1.607148e-01|-1.393958e-06
- 197|1.607146e-01|-1.242735e-06
- 198|1.607144e-01|-1.123993e-06
- 199|1.607143e-01|-3.512071e-07
- It. |Loss |Delta loss
- --------------------------------
- 200|1.607143e-01|-2.151971e-10
+ 160|1.607202e-01|-3.670914e-08
+ 161|1.607197e-01|-3.153709e-06
+ 162|1.607197e-01|-2.419565e-09
+ 163|1.607194e-01|-2.136882e-06
+ 164|1.607194e-01|-1.173754e-09
+ 165|1.607192e-01|-8.169238e-07
+ 166|1.607191e-01|-9.218755e-07
+ 167|1.607189e-01|-9.459255e-07
+ 168|1.607187e-01|-1.294835e-06
+ 169|1.607186e-01|-5.797668e-07
+ 170|1.607186e-01|-4.706272e-08
+ 171|1.607183e-01|-1.753383e-06
+ 172|1.607183e-01|-1.681573e-07
+ 173|1.607183e-01|-2.563971e-10
Solve EMD with Frobenius norm + entropic regularization
@@ -667,7 +636,7 @@ Solve EMD with Frobenius norm + entropic regularization
4|1.609284e-01|-1.111407e-12
-**Total running time of the script:** ( 0 minutes 1.809 seconds)
+**Total running time of the script:** ( 0 minutes 2.800 seconds)
@@ -686,4 +655,4 @@ Solve EMD with Frobenius norm + entropic regularization
.. rst-class:: sphx-glr-signature
- `Generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
+ `Generated by Sphinx-Gallery <http://sphinx-gallery.readthedocs.io>`_
diff --git a/docs/source/auto_examples/plot_otda_classes.rst b/docs/source/auto_examples/plot_otda_classes.rst
index f19a99f..a5ab285 100644
--- a/docs/source/auto_examples/plot_otda_classes.rst
+++ b/docs/source/auto_examples/plot_otda_classes.rst
@@ -94,29 +94,29 @@ Instantiate the different transport algorithms and fit them
It. |Loss |Delta loss
--------------------------------
- 0|9.552437e+00|0.000000e+00
- 1|1.921833e+00|-3.970483e+00
- 2|1.671022e+00|-1.500942e-01
- 3|1.615147e+00|-3.459458e-02
- 4|1.594289e+00|-1.308252e-02
- 5|1.587287e+00|-4.411254e-03
- 6|1.581665e+00|-3.554702e-03
- 7|1.577022e+00|-2.943809e-03
- 8|1.573870e+00|-2.002870e-03
- 9|1.571645e+00|-1.415696e-03
- 10|1.569342e+00|-1.467590e-03
- 11|1.567863e+00|-9.432233e-04
- 12|1.566558e+00|-8.329769e-04
- 13|1.565414e+00|-7.311320e-04
- 14|1.564425e+00|-6.319985e-04
- 15|1.563955e+00|-3.007604e-04
- 16|1.563658e+00|-1.894627e-04
- 17|1.562886e+00|-4.941143e-04
- 18|1.562578e+00|-1.974031e-04
- 19|1.562445e+00|-8.468825e-05
+ 0|1.003747e+01|0.000000e+00
+ 1|1.953263e+00|-4.138821e+00
+ 2|1.744456e+00|-1.196969e-01
+ 3|1.689268e+00|-3.267022e-02
+ 4|1.666355e+00|-1.374998e-02
+ 5|1.656125e+00|-6.177356e-03
+ 6|1.651753e+00|-2.646960e-03
+ 7|1.647261e+00|-2.726957e-03
+ 8|1.642274e+00|-3.036672e-03
+ 9|1.639926e+00|-1.431818e-03
+ 10|1.638750e+00|-7.173837e-04
+ 11|1.637558e+00|-7.281753e-04
+ 12|1.636248e+00|-8.002067e-04
+ 13|1.634555e+00|-1.036074e-03
+ 14|1.633547e+00|-6.166646e-04
+ 15|1.633531e+00|-1.022614e-05
+ 16|1.632957e+00|-3.510986e-04
+ 17|1.632853e+00|-6.380944e-05
+ 18|1.632704e+00|-9.122988e-05
+ 19|1.632237e+00|-2.861276e-04
It. |Loss |Delta loss
--------------------------------
- 20|1.562007e+00|-2.805136e-04
+ 20|1.632174e+00|-3.896483e-05
Fig 1 : plots source and target samples
@@ -236,7 +236,7 @@ Fig 2 : plot optimal couplings and transported samples
-**Total running time of the script:** ( 0 minutes 1.596 seconds)
+**Total running time of the script:** ( 0 minutes 2.308 seconds)
@@ -255,4 +255,4 @@ Fig 2 : plot optimal couplings and transported samples
.. rst-class:: sphx-glr-signature
- `Generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
+ `Generated by Sphinx-Gallery <http://sphinx-gallery.readthedocs.io>`_
diff --git a/docs/source/auto_examples/plot_otda_color_images.rst b/docs/source/auto_examples/plot_otda_color_images.rst
index 4772bed..9c31ba7 100644
--- a/docs/source/auto_examples/plot_otda_color_images.rst
+++ b/docs/source/auto_examples/plot_otda_color_images.rst
@@ -235,7 +235,7 @@ Plot new images
-**Total running time of the script:** ( 2 minutes 24.561 seconds)
+**Total running time of the script:** ( 3 minutes 16.469 seconds)
@@ -254,4 +254,4 @@ Plot new images
.. rst-class:: sphx-glr-signature
- `Generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
+ `Generated by Sphinx-Gallery <http://sphinx-gallery.readthedocs.io>`_
diff --git a/docs/source/auto_examples/plot_otda_d2.rst b/docs/source/auto_examples/plot_otda_d2.rst
index 2b716e1..1bbe6d9 100644
--- a/docs/source/auto_examples/plot_otda_d2.rst
+++ b/docs/source/auto_examples/plot_otda_d2.rst
@@ -242,7 +242,7 @@ Fig 3 : plot transported samples
-**Total running time of the script:** ( 0 minutes 32.084 seconds)
+**Total running time of the script:** ( 0 minutes 47.000 seconds)
@@ -261,4 +261,4 @@ Fig 3 : plot transported samples
.. rst-class:: sphx-glr-signature
- `Generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
+ `Generated by Sphinx-Gallery <http://sphinx-gallery.readthedocs.io>`_
diff --git a/docs/source/auto_examples/plot_otda_mapping.rst b/docs/source/auto_examples/plot_otda_mapping.rst
index 6c1c780..1e3a709 100644
--- a/docs/source/auto_examples/plot_otda_mapping.rst
+++ b/docs/source/auto_examples/plot_otda_mapping.rst
@@ -136,24 +136,26 @@ Instantiate the different transport algorithms and fit them
It. |Loss |Delta loss
--------------------------------
- 0|4.307233e+03|0.000000e+00
- 1|4.296694e+03|-2.446759e-03
- 2|4.296419e+03|-6.417421e-05
- 3|4.296328e+03|-2.110209e-05
- 4|4.296305e+03|-5.298603e-06
+ 0|4.231423e+03|0.000000e+00
+ 1|4.217955e+03|-3.182835e-03
+ 2|4.217580e+03|-8.885864e-05
+ 3|4.217451e+03|-3.043162e-05
+ 4|4.217368e+03|-1.978325e-05
+ 5|4.217312e+03|-1.338471e-05
+ 6|4.217307e+03|-1.000290e-06
It. |Loss |Delta loss
--------------------------------
- 0|4.325624e+02|0.000000e+00
- 1|4.281958e+02|-1.009489e-02
- 2|4.279370e+02|-6.042202e-04
- 3|4.278109e+02|-2.947651e-04
- 4|4.277212e+02|-2.096651e-04
- 5|4.276589e+02|-1.456221e-04
- 6|4.276141e+02|-1.048476e-04
- 7|4.275803e+02|-7.906213e-05
- 8|4.275531e+02|-6.360573e-05
- 9|4.275314e+02|-5.076642e-05
- 10|4.275129e+02|-4.325858e-05
+ 0|4.257004e+02|0.000000e+00
+ 1|4.208978e+02|-1.128168e-02
+ 2|4.205168e+02|-9.052112e-04
+ 3|4.203566e+02|-3.810681e-04
+ 4|4.202570e+02|-2.369884e-04
+ 5|4.201844e+02|-1.726132e-04
+ 6|4.201341e+02|-1.196461e-04
+ 7|4.200941e+02|-9.525441e-05
+ 8|4.200630e+02|-7.405552e-05
+ 9|4.200377e+02|-6.031884e-05
+ 10|4.200168e+02|-4.968324e-05
Plot transported samples
@@ -206,7 +208,7 @@ Plot transported samples
-**Total running time of the script:** ( 0 minutes 0.747 seconds)
+**Total running time of the script:** ( 0 minutes 0.970 seconds)
@@ -225,4 +227,4 @@ Plot transported samples
.. rst-class:: sphx-glr-signature
- `Generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
+ `Generated by Sphinx-Gallery <http://sphinx-gallery.readthedocs.io>`_
diff --git a/docs/source/auto_examples/plot_otda_mapping_colors_images.rst b/docs/source/auto_examples/plot_otda_mapping_colors_images.rst
index 86b1312..8394fb0 100644
--- a/docs/source/auto_examples/plot_otda_mapping_colors_images.rst
+++ b/docs/source/auto_examples/plot_otda_mapping_colors_images.rst
@@ -132,39 +132,39 @@ Domain adaptation for pixel distribution transfer
It. |Loss |Delta loss
--------------------------------
- 0|3.680512e+02|0.000000e+00
- 1|3.592454e+02|-2.392562e-02
- 2|3.590671e+02|-4.960473e-04
- 3|3.589736e+02|-2.604894e-04
- 4|3.589161e+02|-1.602816e-04
- 5|3.588766e+02|-1.099971e-04
- 6|3.588476e+02|-8.084400e-05
- 7|3.588256e+02|-6.131161e-05
- 8|3.588083e+02|-4.807549e-05
- 9|3.587943e+02|-3.899414e-05
- 10|3.587827e+02|-3.245280e-05
- 11|3.587729e+02|-2.721256e-05
- 12|3.587646e+02|-2.316249e-05
- 13|3.587574e+02|-2.000192e-05
- 14|3.587512e+02|-1.748898e-05
- 15|3.587457e+02|-1.535131e-05
- 16|3.587408e+02|-1.366515e-05
- 17|3.587364e+02|-1.210563e-05
- 18|3.587325e+02|-1.097138e-05
- 19|3.587310e+02|-4.099596e-06
+ 0|3.680518e+02|0.000000e+00
+ 1|3.592439e+02|-2.393116e-02
+ 2|3.590632e+02|-5.030248e-04
+ 3|3.589698e+02|-2.601358e-04
+ 4|3.589118e+02|-1.614977e-04
+ 5|3.588724e+02|-1.097608e-04
+ 6|3.588436e+02|-8.035205e-05
+ 7|3.588215e+02|-6.141923e-05
+ 8|3.588042e+02|-4.832627e-05
+ 9|3.587902e+02|-3.909574e-05
+ 10|3.587786e+02|-3.225418e-05
+ 11|3.587688e+02|-2.712592e-05
+ 12|3.587605e+02|-2.314041e-05
+ 13|3.587534e+02|-1.991287e-05
+ 14|3.587471e+02|-1.744348e-05
+ 15|3.587416e+02|-1.544523e-05
+ 16|3.587367e+02|-1.364654e-05
+ 17|3.587323e+02|-1.230435e-05
+ 18|3.587284e+02|-1.093370e-05
+ 19|3.587276e+02|-2.052728e-06
It. |Loss |Delta loss
--------------------------------
- 0|3.784805e+02|0.000000e+00
- 1|3.646476e+02|-3.654847e-02
- 2|3.642970e+02|-9.615381e-04
- 3|3.641622e+02|-3.699897e-04
- 4|3.640886e+02|-2.021154e-04
- 5|3.640419e+02|-1.280913e-04
- 6|3.640096e+02|-8.898145e-05
- 7|3.639858e+02|-6.514301e-05
- 8|3.639677e+02|-4.977195e-05
- 9|3.639534e+02|-3.936050e-05
- 10|3.639417e+02|-3.205223e-05
+ 0|3.784758e+02|0.000000e+00
+ 1|3.646352e+02|-3.656911e-02
+ 2|3.642861e+02|-9.574714e-04
+ 3|3.641523e+02|-3.672061e-04
+ 4|3.640788e+02|-2.020990e-04
+ 5|3.640321e+02|-1.282701e-04
+ 6|3.640002e+02|-8.751240e-05
+ 7|3.639765e+02|-6.521203e-05
+ 8|3.639582e+02|-5.007767e-05
+ 9|3.639439e+02|-3.938917e-05
+ 10|3.639323e+02|-3.187865e-05
Plot original images
@@ -283,7 +283,7 @@ Plot transformed images
-**Total running time of the script:** ( 2 minutes 5.213 seconds)
+**Total running time of the script:** ( 2 minutes 52.212 seconds)
@@ -302,4 +302,4 @@ Plot transformed images
.. rst-class:: sphx-glr-signature
- `Generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
+ `Generated by Sphinx-Gallery <http://sphinx-gallery.readthedocs.io>`_
diff --git a/docs/source/auto_examples/plot_otda_semi_supervised.ipynb b/docs/source/auto_examples/plot_otda_semi_supervised.ipynb
new file mode 100644
index 0000000..783bf84
--- /dev/null
+++ b/docs/source/auto_examples/plot_otda_semi_supervised.ipynb
@@ -0,0 +1,144 @@
+{
+ "nbformat_minor": 0,
+ "nbformat": 4,
+ "cells": [
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "%matplotlib inline"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "\n# OTDA unsupervised vs semi-supervised setting\n\n\nThis example introduces a semi supervised domain adaptation in a 2D setting.\nIt explicits the problem of semi supervised domain adaptation and introduces\nsome optimal transport approaches to solve it.\n\nQuantities such as optimal couplings, greater coupling coefficients and\ntransported samples are represented in order to give a visual understanding\nof what the transport methods are doing.\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "# Authors: Remi Flamary <remi.flamary@unice.fr>\n# Stanislas Chambon <stan.chambon@gmail.com>\n#\n# License: MIT License\n\nimport matplotlib.pylab as pl\nimport ot"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "Generate data\n-------------\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "n_samples_source = 150\nn_samples_target = 150\n\nXs, ys = ot.datasets.get_data_classif('3gauss', n_samples_source)\nXt, yt = ot.datasets.get_data_classif('3gauss2', n_samples_target)"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "Transport source samples onto target samples\n--------------------------------------------\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "# unsupervised domain adaptation\not_sinkhorn_un = ot.da.SinkhornTransport(reg_e=1e-1)\not_sinkhorn_un.fit(Xs=Xs, Xt=Xt)\ntransp_Xs_sinkhorn_un = ot_sinkhorn_un.transform(Xs=Xs)\n\n# semi-supervised domain adaptation\not_sinkhorn_semi = ot.da.SinkhornTransport(reg_e=1e-1)\not_sinkhorn_semi.fit(Xs=Xs, Xt=Xt, ys=ys, yt=yt)\ntransp_Xs_sinkhorn_semi = ot_sinkhorn_semi.transform(Xs=Xs)\n\n# semi supervised DA uses available labaled target samples to modify the cost\n# matrix involved in the OT problem. The cost of transporting a source sample\n# of class A onto a target sample of class B != A is set to infinite, or a\n# very large value\n\n# note that in the present case we consider that all the target samples are\n# labeled. For daily applications, some target sample might not have labels,\n# in this case the element of yt corresponding to these samples should be\n# filled with -1.\n\n# Warning: we recall that -1 cannot be used as a class label"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "Fig 1 : plots source and target samples + matrix of pairwise distance\n---------------------------------------------------------------------\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "pl.figure(1, figsize=(10, 10))\npl.subplot(2, 2, 1)\npl.scatter(Xs[:, 0], Xs[:, 1], c=ys, marker='+', label='Source samples')\npl.xticks([])\npl.yticks([])\npl.legend(loc=0)\npl.title('Source samples')\n\npl.subplot(2, 2, 2)\npl.scatter(Xt[:, 0], Xt[:, 1], c=yt, marker='o', label='Target samples')\npl.xticks([])\npl.yticks([])\npl.legend(loc=0)\npl.title('Target samples')\n\npl.subplot(2, 2, 3)\npl.imshow(ot_sinkhorn_un.cost_, interpolation='nearest')\npl.xticks([])\npl.yticks([])\npl.title('Cost matrix - unsupervised DA')\n\npl.subplot(2, 2, 4)\npl.imshow(ot_sinkhorn_semi.cost_, interpolation='nearest')\npl.xticks([])\npl.yticks([])\npl.title('Cost matrix - semisupervised DA')\n\npl.tight_layout()\n\n# the optimal coupling in the semi-supervised DA case will exhibit \" shape\n# similar\" to the cost matrix, (block diagonal matrix)"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "Fig 2 : plots optimal couplings for the different methods\n---------------------------------------------------------\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "pl.figure(2, figsize=(8, 4))\n\npl.subplot(1, 2, 1)\npl.imshow(ot_sinkhorn_un.coupling_, interpolation='nearest')\npl.xticks([])\npl.yticks([])\npl.title('Optimal coupling\\nUnsupervised DA')\n\npl.subplot(1, 2, 2)\npl.imshow(ot_sinkhorn_semi.coupling_, interpolation='nearest')\npl.xticks([])\npl.yticks([])\npl.title('Optimal coupling\\nSemi-supervised DA')\n\npl.tight_layout()"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ },
+ {
+ "source": [
+ "Fig 3 : plot transported samples\n--------------------------------\n\n"
+ ],
+ "cell_type": "markdown",
+ "metadata": {}
+ },
+ {
+ "execution_count": null,
+ "cell_type": "code",
+ "source": [
+ "# display transported samples\npl.figure(4, figsize=(8, 4))\npl.subplot(1, 2, 1)\npl.scatter(Xt[:, 0], Xt[:, 1], c=yt, marker='o',\n label='Target samples', alpha=0.5)\npl.scatter(transp_Xs_sinkhorn_un[:, 0], transp_Xs_sinkhorn_un[:, 1], c=ys,\n marker='+', label='Transp samples', s=30)\npl.title('Transported samples\\nEmdTransport')\npl.legend(loc=0)\npl.xticks([])\npl.yticks([])\n\npl.subplot(1, 2, 2)\npl.scatter(Xt[:, 0], Xt[:, 1], c=yt, marker='o',\n label='Target samples', alpha=0.5)\npl.scatter(transp_Xs_sinkhorn_semi[:, 0], transp_Xs_sinkhorn_semi[:, 1], c=ys,\n marker='+', label='Transp samples', s=30)\npl.title('Transported samples\\nSinkhornTransport')\npl.xticks([])\npl.yticks([])\n\npl.tight_layout()\npl.show()"
+ ],
+ "outputs": [],
+ "metadata": {
+ "collapsed": false
+ }
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "name": "python2",
+ "language": "python"
+ },
+ "language_info": {
+ "mimetype": "text/x-python",
+ "nbconvert_exporter": "python",
+ "name": "python",
+ "file_extension": ".py",
+ "version": "2.7.12",
+ "pygments_lexer": "ipython2",
+ "codemirror_mode": {
+ "version": 2,
+ "name": "ipython"
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/docs/source/auto_examples/plot_otda_semi_supervised.py b/docs/source/auto_examples/plot_otda_semi_supervised.py
new file mode 100644
index 0000000..7963aef
--- /dev/null
+++ b/docs/source/auto_examples/plot_otda_semi_supervised.py
@@ -0,0 +1,148 @@
+# -*- coding: utf-8 -*-
+"""
+============================================
+OTDA unsupervised vs semi-supervised setting
+============================================
+
+This example introduces a semi supervised domain adaptation in a 2D setting.
+It explicits the problem of semi supervised domain adaptation and introduces
+some optimal transport approaches to solve it.
+
+Quantities such as optimal couplings, greater coupling coefficients and
+transported samples are represented in order to give a visual understanding
+of what the transport methods are doing.
+"""
+
+# Authors: Remi Flamary <remi.flamary@unice.fr>
+# Stanislas Chambon <stan.chambon@gmail.com>
+#
+# License: MIT License
+
+import matplotlib.pylab as pl
+import ot
+
+
+##############################################################################
+# Generate data
+# -------------
+
+n_samples_source = 150
+n_samples_target = 150
+
+Xs, ys = ot.datasets.get_data_classif('3gauss', n_samples_source)
+Xt, yt = ot.datasets.get_data_classif('3gauss2', n_samples_target)
+
+
+##############################################################################
+# Transport source samples onto target samples
+# --------------------------------------------
+
+
+# unsupervised domain adaptation
+ot_sinkhorn_un = ot.da.SinkhornTransport(reg_e=1e-1)
+ot_sinkhorn_un.fit(Xs=Xs, Xt=Xt)
+transp_Xs_sinkhorn_un = ot_sinkhorn_un.transform(Xs=Xs)
+
+# semi-supervised domain adaptation
+ot_sinkhorn_semi = ot.da.SinkhornTransport(reg_e=1e-1)
+ot_sinkhorn_semi.fit(Xs=Xs, Xt=Xt, ys=ys, yt=yt)
+transp_Xs_sinkhorn_semi = ot_sinkhorn_semi.transform(Xs=Xs)
+
+# semi supervised DA uses available labaled target samples to modify the cost
+# matrix involved in the OT problem. The cost of transporting a source sample
+# of class A onto a target sample of class B != A is set to infinite, or a
+# very large value
+
+# note that in the present case we consider that all the target samples are
+# labeled. For daily applications, some target sample might not have labels,
+# in this case the element of yt corresponding to these samples should be
+# filled with -1.
+
+# Warning: we recall that -1 cannot be used as a class label
+
+
+##############################################################################
+# Fig 1 : plots source and target samples + matrix of pairwise distance
+# ---------------------------------------------------------------------
+
+pl.figure(1, figsize=(10, 10))
+pl.subplot(2, 2, 1)
+pl.scatter(Xs[:, 0], Xs[:, 1], c=ys, marker='+', label='Source samples')
+pl.xticks([])
+pl.yticks([])
+pl.legend(loc=0)
+pl.title('Source samples')
+
+pl.subplot(2, 2, 2)
+pl.scatter(Xt[:, 0], Xt[:, 1], c=yt, marker='o', label='Target samples')
+pl.xticks([])
+pl.yticks([])
+pl.legend(loc=0)
+pl.title('Target samples')
+
+pl.subplot(2, 2, 3)
+pl.imshow(ot_sinkhorn_un.cost_, interpolation='nearest')
+pl.xticks([])
+pl.yticks([])
+pl.title('Cost matrix - unsupervised DA')
+
+pl.subplot(2, 2, 4)
+pl.imshow(ot_sinkhorn_semi.cost_, interpolation='nearest')
+pl.xticks([])
+pl.yticks([])
+pl.title('Cost matrix - semisupervised DA')
+
+pl.tight_layout()
+
+# the optimal coupling in the semi-supervised DA case will exhibit " shape
+# similar" to the cost matrix, (block diagonal matrix)
+
+
+##############################################################################
+# Fig 2 : plots optimal couplings for the different methods
+# ---------------------------------------------------------
+
+pl.figure(2, figsize=(8, 4))
+
+pl.subplot(1, 2, 1)
+pl.imshow(ot_sinkhorn_un.coupling_, interpolation='nearest')
+pl.xticks([])
+pl.yticks([])
+pl.title('Optimal coupling\nUnsupervised DA')
+
+pl.subplot(1, 2, 2)
+pl.imshow(ot_sinkhorn_semi.coupling_, interpolation='nearest')
+pl.xticks([])
+pl.yticks([])
+pl.title('Optimal coupling\nSemi-supervised DA')
+
+pl.tight_layout()
+
+
+##############################################################################
+# Fig 3 : plot transported samples
+# --------------------------------
+
+# display transported samples
+pl.figure(4, figsize=(8, 4))
+pl.subplot(1, 2, 1)
+pl.scatter(Xt[:, 0], Xt[:, 1], c=yt, marker='o',
+ label='Target samples', alpha=0.5)
+pl.scatter(transp_Xs_sinkhorn_un[:, 0], transp_Xs_sinkhorn_un[:, 1], c=ys,
+ marker='+', label='Transp samples', s=30)
+pl.title('Transported samples\nEmdTransport')
+pl.legend(loc=0)
+pl.xticks([])
+pl.yticks([])
+
+pl.subplot(1, 2, 2)
+pl.scatter(Xt[:, 0], Xt[:, 1], c=yt, marker='o',
+ label='Target samples', alpha=0.5)
+pl.scatter(transp_Xs_sinkhorn_semi[:, 0], transp_Xs_sinkhorn_semi[:, 1], c=ys,
+ marker='+', label='Transp samples', s=30)
+pl.title('Transported samples\nSinkhornTransport')
+pl.xticks([])
+pl.yticks([])
+
+pl.tight_layout()
+pl.show()
diff --git a/docs/source/auto_examples/plot_otda_semi_supervised.rst b/docs/source/auto_examples/plot_otda_semi_supervised.rst
new file mode 100644
index 0000000..dc05ed0
--- /dev/null
+++ b/docs/source/auto_examples/plot_otda_semi_supervised.rst
@@ -0,0 +1,240 @@
+
+
+.. _sphx_glr_auto_examples_plot_otda_semi_supervised.py:
+
+
+============================================
+OTDA unsupervised vs semi-supervised setting
+============================================
+
+This example introduces a semi supervised domain adaptation in a 2D setting.
+It explicits the problem of semi supervised domain adaptation and introduces
+some optimal transport approaches to solve it.
+
+Quantities such as optimal couplings, greater coupling coefficients and
+transported samples are represented in order to give a visual understanding
+of what the transport methods are doing.
+
+
+
+.. code-block:: python
+
+
+ # Authors: Remi Flamary <remi.flamary@unice.fr>
+ # Stanislas Chambon <stan.chambon@gmail.com>
+ #
+ # License: MIT License
+
+ import matplotlib.pylab as pl
+ import ot
+
+
+
+
+
+
+
+
+Generate data
+-------------
+
+
+
+.. code-block:: python
+
+
+ n_samples_source = 150
+ n_samples_target = 150
+
+ Xs, ys = ot.datasets.get_data_classif('3gauss', n_samples_source)
+ Xt, yt = ot.datasets.get_data_classif('3gauss2', n_samples_target)
+
+
+
+
+
+
+
+
+Transport source samples onto target samples
+--------------------------------------------
+
+
+
+.. code-block:: python
+
+
+
+ # unsupervised domain adaptation
+ ot_sinkhorn_un = ot.da.SinkhornTransport(reg_e=1e-1)
+ ot_sinkhorn_un.fit(Xs=Xs, Xt=Xt)
+ transp_Xs_sinkhorn_un = ot_sinkhorn_un.transform(Xs=Xs)
+
+ # semi-supervised domain adaptation
+ ot_sinkhorn_semi = ot.da.SinkhornTransport(reg_e=1e-1)
+ ot_sinkhorn_semi.fit(Xs=Xs, Xt=Xt, ys=ys, yt=yt)
+ transp_Xs_sinkhorn_semi = ot_sinkhorn_semi.transform(Xs=Xs)
+
+ # semi supervised DA uses available labaled target samples to modify the cost
+ # matrix involved in the OT problem. The cost of transporting a source sample
+ # of class A onto a target sample of class B != A is set to infinite, or a
+ # very large value
+
+ # note that in the present case we consider that all the target samples are
+ # labeled. For daily applications, some target sample might not have labels,
+ # in this case the element of yt corresponding to these samples should be
+ # filled with -1.
+
+ # Warning: we recall that -1 cannot be used as a class label
+
+
+
+
+
+
+
+
+Fig 1 : plots source and target samples + matrix of pairwise distance
+---------------------------------------------------------------------
+
+
+
+.. code-block:: python
+
+
+ pl.figure(1, figsize=(10, 10))
+ pl.subplot(2, 2, 1)
+ pl.scatter(Xs[:, 0], Xs[:, 1], c=ys, marker='+', label='Source samples')
+ pl.xticks([])
+ pl.yticks([])
+ pl.legend(loc=0)
+ pl.title('Source samples')
+
+ pl.subplot(2, 2, 2)
+ pl.scatter(Xt[:, 0], Xt[:, 1], c=yt, marker='o', label='Target samples')
+ pl.xticks([])
+ pl.yticks([])
+ pl.legend(loc=0)
+ pl.title('Target samples')
+
+ pl.subplot(2, 2, 3)
+ pl.imshow(ot_sinkhorn_un.cost_, interpolation='nearest')
+ pl.xticks([])
+ pl.yticks([])
+ pl.title('Cost matrix - unsupervised DA')
+
+ pl.subplot(2, 2, 4)
+ pl.imshow(ot_sinkhorn_semi.cost_, interpolation='nearest')
+ pl.xticks([])
+ pl.yticks([])
+ pl.title('Cost matrix - semisupervised DA')
+
+ pl.tight_layout()
+
+ # the optimal coupling in the semi-supervised DA case will exhibit " shape
+ # similar" to the cost matrix, (block diagonal matrix)
+
+
+
+
+
+.. image:: /auto_examples/images/sphx_glr_plot_otda_semi_supervised_001.png
+ :align: center
+
+
+
+
+Fig 2 : plots optimal couplings for the different methods
+---------------------------------------------------------
+
+
+
+.. code-block:: python
+
+
+ pl.figure(2, figsize=(8, 4))
+
+ pl.subplot(1, 2, 1)
+ pl.imshow(ot_sinkhorn_un.coupling_, interpolation='nearest')
+ pl.xticks([])
+ pl.yticks([])
+ pl.title('Optimal coupling\nUnsupervised DA')
+
+ pl.subplot(1, 2, 2)
+ pl.imshow(ot_sinkhorn_semi.coupling_, interpolation='nearest')
+ pl.xticks([])
+ pl.yticks([])
+ pl.title('Optimal coupling\nSemi-supervised DA')
+
+ pl.tight_layout()
+
+
+
+
+
+.. image:: /auto_examples/images/sphx_glr_plot_otda_semi_supervised_003.png
+ :align: center
+
+
+
+
+Fig 3 : plot transported samples
+--------------------------------
+
+
+
+.. code-block:: python
+
+
+ # display transported samples
+ pl.figure(4, figsize=(8, 4))
+ pl.subplot(1, 2, 1)
+ pl.scatter(Xt[:, 0], Xt[:, 1], c=yt, marker='o',
+ label='Target samples', alpha=0.5)
+ pl.scatter(transp_Xs_sinkhorn_un[:, 0], transp_Xs_sinkhorn_un[:, 1], c=ys,
+ marker='+', label='Transp samples', s=30)
+ pl.title('Transported samples\nEmdTransport')
+ pl.legend(loc=0)
+ pl.xticks([])
+ pl.yticks([])
+
+ pl.subplot(1, 2, 2)
+ pl.scatter(Xt[:, 0], Xt[:, 1], c=yt, marker='o',
+ label='Target samples', alpha=0.5)
+ pl.scatter(transp_Xs_sinkhorn_semi[:, 0], transp_Xs_sinkhorn_semi[:, 1], c=ys,
+ marker='+', label='Transp samples', s=30)
+ pl.title('Transported samples\nSinkhornTransport')
+ pl.xticks([])
+ pl.yticks([])
+
+ pl.tight_layout()
+ pl.show()
+
+
+
+.. image:: /auto_examples/images/sphx_glr_plot_otda_semi_supervised_006.png
+ :align: center
+
+
+
+
+**Total running time of the script:** ( 0 minutes 0.714 seconds)
+
+
+
+.. container:: sphx-glr-footer
+
+
+ .. container:: sphx-glr-download
+
+ :download:`Download Python source code: plot_otda_semi_supervised.py <plot_otda_semi_supervised.py>`
+
+
+
+ .. container:: sphx-glr-download
+
+ :download:`Download Jupyter notebook: plot_otda_semi_supervised.ipynb <plot_otda_semi_supervised.ipynb>`
+
+.. rst-class:: sphx-glr-signature
+
+ `Generated by Sphinx-Gallery <http://sphinx-gallery.readthedocs.io>`_
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 7bf392c..4105d87 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -33,7 +33,7 @@ class Mock(MagicMock):
return MagicMock()
MOCK_MODULES = ['ot.lp.emd_wrap','autograd','pymanopt','cudamat','autograd.numpy','pymanopt.manifolds','pymanopt.solvers']
# 'autograd.numpy','pymanopt.manifolds','pymanopt.solvers',
-#sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
+sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
# !!!!
# If extensions (or modules to document with autodoc) are in another directory,
@@ -62,7 +62,7 @@ extensions = [
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
- 'sphinx_gallery.gen_gallery',
+ #'sphinx_gallery.gen_gallery',
]
# Add any paths that contain templates here, relative to this directory.