@@ -417,7 +417,7 @@ operators. We provide an implementation of this algorithm in function
417
417
Barycenters with free support
418
418
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
419
419
420
- Estimating the Wassresein barycenter with free support but fixed weights
420
+ Estimating the Wasserstein barycenter with free support but fixed weights
421
421
corresponds to solving the following optimization problem:
422
422
423
423
.. math ::
@@ -555,7 +555,7 @@ be in the Stiefel manifold. WDA can be solved in pot using function
555
555
:any: `ot.dr.wda `. It requires to have installed :code: `pymanopt ` and
556
556
:code: `autograd ` for manifold optimization and automatic differentiation
557
557
respectively. Note that we also provide the Fisher discriminant estimator in
558
- :any: `ot.dr.wda ` for easy comparison.
558
+ :any: `ot.dr.fda ` for easy comparison.
559
559
560
560
.. warning ::
561
561
Note that due to the hard dependency on :code: `pymanopt ` and
@@ -585,17 +585,104 @@ problem:
585
585
where KL is the Kullback-Leibler divergence. This formulation allwos for
586
586
computing approximate mapping between distributions that do not have the same
587
587
amount of mass. Interestingly the problem can be solved with a generalization of
588
- the Bregman projections algorithm [10 ]_.
588
+ the Bregman projections algorithm [10 ]_. We provide a solver for unbalanced OT
589
+ in :any: `ot.unbalanced ` and more specifically
590
+ in function :any: `ot.sinkhorn_unbalanced `. A solver for unbalanced OT barycenter
591
+ is available in :any: `ot.barycenter_unbalanced `.
592
+
593
+
594
+ .. hint ::
595
+
596
+ Examples of the use of :any: `ot.sinkhorn_unbalanced ` and
597
+ :any: `ot.barycenter_unbalanced ` are available in:
598
+
599
+ - :any: `auto_examples/plot_UOT_1D `
600
+ - :any: `auto_examples/plot_UOT_barycenter_1D `
601
+
589
602
590
603
Gromov-Wasserstein
591
604
^^^^^^^^^^^^^^^^^^
592
605
606
+ Gromov Wasserstein (GW) is a generalization of OT to distributions that do not lie in
607
+ the same space [13 ]_. In this case one cannot compute distance between samples
608
+ from the two distributions. [13 ]_ proposed instead to realign the metric spaces
609
+ by computing a transport between distance matrices. The Gromow Wasserstein
610
+ alignement between two distributions can be expressed as the one minimizing:
611
+
612
+
613
+ .. math ::
614
+ GW = \min _\gamma \sum _{i,j,k,l} L(C1 _{i,k},C2 _{j,l})*\gamma _{i,j}*\gamma _{k,l}
615
+
616
+ s.t. \gamma 1 = a; \gamma ^T 1 = b; \gamma\geq 0
617
+
618
+ where ::math: `C1 ` is the distance matrix between samples in the source
619
+ distribution and :math: `C2 ` the one between samples in the target, :math: `L(C1 _{i,k},C2 _{j,l})` is a measure of similarity between
620
+ :math: `C1 _{i,k}` and :math: `C2 _{j,l}` often chosen as
621
+ :math: `L(C1 _{i,k},C2 _{j,l})=\| C1 _{i,k}-C2 _{j,l}\| ^2 `. The optimization problem
622
+ above is a non-convex quadratic program but we provide a solver that finds a
623
+ local minimum using conditional gradient in :any: `ot.gromov.gromov_wasserstein `.
624
+ There also exist an entropic regularized variant of GW that has been proposed in
625
+ [12 ]_ and we provide an implementation of their algorithm in
626
+ :any: `ot.gromov.entropic_gromov_wasserstein `.
627
+
628
+ Note that similarly to Wasserstein distance GW allows for the definition of GW
629
+ barycenters that cen be expressed as
630
+
631
+ .. math ::
632
+ \min _{C\geq 0 } \quad \sum _{k} w_k GW(C,Ck)
633
+
634
+ where :math: `Ck` is the distance matrix between samples in distribution
635
+ :math: `k`. Note that interestingly the barycenter is defined a a symmetric
636
+ positive matrix. We provide a block coordinate optimization procedure in
637
+ :any: `ot.gromov.gromov_barycenters ` and
638
+ :any: `ot.gromov.entropic_gromov_barycenters ` for non-regularized and regularized
639
+ barycenters respectively.
640
+
641
+ Finally note that recently a fusion between Wasserstein and GW, coined Fused
642
+ Groimov-Wasserstein (FGW) has been proposed
643
+ in [24 ]_. It allows to compute a similarity between objects that are only partly in
644
+ the same space. As such it can be used to measure similarity between labeled
645
+ graphs for instance and also provide computable barycenters.
646
+ The implementations of FGW is provided in functions
647
+ :any: `ot.gromov.fused_gromov_wasserstein ` and :any: `ot.gromov.fgw_barycenters `.
648
+
649
+ .. hint ::
650
+
651
+ Examples of computation of GW, regularized G and FGW are provided in :
652
+
653
+ - :any: `auto_examples/plot_gromov `
654
+ - :any: `auto_examples/plot_fgw `
655
+
656
+ Examples of GW, regularized GW and FGW barycenters are available in :
657
+
658
+ - :any: `auto_examples/plot_gromov_barycenter `
659
+ - :any: `auto_examples/plot_barycenter_fgw `
660
+
593
661
594
662
GPU acceleration
595
663
^^^^^^^^^^^^^^^^
596
664
597
665
We provide several implementation of our OT solvers in :any: `ot.gpu `. Those
598
- implementation use the :code: `cupy ` toolbox.
666
+ implementation use the :code: `cupy ` toolbox that obviously need to be installed.
667
+
668
+
669
+ .. note ::
670
+
671
+ Several implementations of POT functions (mainly those relying on linear
672
+ algebra) have been implemented in :any: `ot.gpu `. Here is a short list on the
673
+ main entries:
674
+
675
+ - :any: `ot.gpu.dist ` : computation of distance matrix
676
+ - :any: `ot.gpu.sinkhorn ` : computation of sinkhorn
677
+ - :any: `ot.gpu.sinkhorn_lpl1_mm ` : computation of sinkhorn + group lasso
678
+
679
+ Note that while the :any: `ot.gpu ` module has been designed to be compatible with
680
+ POT, calling its function with numpy array will incur a large overhead due to
681
+ the memory copy of the array on GPU prior to computation and conversion of the
682
+ array after computation. To avoid this overhead, we provide functions
683
+ :any: `ot.gpu.to_gpu ` and :any: `ot.gpu.to_np ` that perform the conversion
684
+ explicitly.
685
+
599
686
600
687
.. warning ::
601
688
Note that due to the hard dependency on :code: `cupy `, :any: `ot.gpu ` is not
@@ -735,7 +822,7 @@ References
735
822
matching <https://media.adelaide.edu.au/acvt/Publications/2011/2011-Gromov%E2%80%93Wasserstein%20Distances%20and%20the%20Metric%20Approach%20to%20Object%20Matching.pdf> `__.
736
823
Foundations of computational mathematics 11.4 : 417-487.
737
824
738
- .. [14 ] Knott, M. and Smith, C. S. (1984).`On the optimal mapping of
825
+ .. [14 ] Knott, M. and Smith, C. S. (1984). `On the optimal mapping of
739
826
distributions <https://link.springer.com/article/10.1007/BF00934745> `__,
740
827
Journal of Optimization Theory and Applications Vol 43.
741
828
0 commit comments