You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,10 @@ This open source Python library provide several solvers for optimization problem
14
14
It provides the following solvers:
15
15
16
16
* OT Network Flow solver for the linear program/ Earth Movers Distance [1].
17
-
* Entropic regularization OT solver with Sinkhorn Knopp Algorithm [2] and stabilized version [9][10] with optional GPU implementation (requires cudamat).
17
+
* Entropic regularization OT solver with Sinkhorn Knopp Algorithm [2] and stabilized version [9][10]and greedy SInkhorn [22]with optional GPU implementation (requires cudamat).
18
18
* Smooth optimal transport solvers (dual and semi-dual) for KL and squared L2 regularizations [17].
19
19
* Non regularized Wasserstein barycenters [16] with LP solver (only small scale).
20
-
* Bregman projections for Wasserstein barycenter [3] and unmixing [4].
20
+
* Bregman projections for Wasserstein barycenter [3], convolutional barycenter [21] and unmixing [4].
21
21
* Optimal transport for domain adaptation with group lasso regularization [5]
22
22
* Conditional gradient [6] and Generalized conditional gradient for regularized OT [7].
23
23
* Linear OT [14] and Joint OT matrix and mapping estimation [8].
@@ -165,6 +165,7 @@ The contributors to this library are:
This toolbox benefit a lot from open source research and we would like to thank the following persons for providing some code (in various languages):
170
171
@@ -230,3 +231,5 @@ You can also post bug reports and feature requests in Github issues. Make sure t
230
231
[20] Cuturi, M. and Doucet, A. (2014) [Fast Computation of Wasserstein Barycenters](http://proceedings.mlr.press/v32/cuturi14.html). International Conference in Machine Learning
231
232
232
233
[21] Solomon, J., De Goes, F., Peyré, G., Cuturi, M., Butscher, A., Nguyen, A. & Guibas, L. (2015). [Convolutional wasserstein distances: Efficient optimal transportation on geometric domains](https://dl.acm.org/citation.cfm?id=2766963). ACM Transactions on Graphics (TOG), 34(4), 66.
234
+
235
+
[22] J. Altschuler, J.Weed, P. Rigollet, (2017) [Near-linear time approximation algorithms for optimal transport via Sinkhorn iteration](https://papers.nips.cc/paper/6792-near-linear-time-approximation-algorithms-for-optimal-transport-via-sinkhorn-iteration.pdf), Advances in Neural Information Processing Systems (NIPS) 31
.. [10] Chizat, L., Peyré, G., Schmitzer, B., & Vialard, F. X. (2016). Scaling algorithms for unbalanced transport problems. arXiv preprint arXiv:1607.05816.
199
203
204
+
[21] Altschuler J., Weed J., Rigollet P. : Near-linear time approximation algorithms for optimal transport via Sinkhorn iteration, Advances in Neural Information Processing Systems (NIPS) 31, 2017
- :math:`\Omega` is the entropic regularization term :math:`\Omega(\gamma)=\sum_{i,j} \gamma_{i,j}\log(\gamma_{i,j})`
446
+
- a and b are source and target weights (sum to 1)
447
+
448
+
449
+
450
+
Parameters
451
+
----------
452
+
a : np.ndarray (ns,)
453
+
samples weights in the source domain
454
+
b : np.ndarray (nt,) or np.ndarray (nt,nbb)
455
+
samples in the target domain, compute sinkhorn with multiple targets
456
+
and fixed M if b is a matrix (return OT loss + dual variables in log)
457
+
M : np.ndarray (ns,nt)
458
+
loss matrix
459
+
reg : float
460
+
Regularization term >0
461
+
numItermax : int, optional
462
+
Max number of iterations
463
+
stopThr : float, optional
464
+
Stop threshol on error (>0)
465
+
log : bool, optional
466
+
record log if True
467
+
468
+
469
+
Returns
470
+
-------
471
+
gamma : (ns x nt) ndarray
472
+
Optimal transportation matrix for the given parameters
473
+
log : dict
474
+
log dictionary return only if log==True in parameters
475
+
476
+
Examples
477
+
--------
478
+
479
+
>>> import ot
480
+
>>> a=[.5,.5]
481
+
>>> b=[.5,.5]
482
+
>>> M=[[0.,1.],[1.,0.]]
483
+
>>> ot.bregman.greenkhorn(a,b,M,1)
484
+
array([[ 0.36552929, 0.13447071],
485
+
[ 0.13447071, 0.36552929]])
486
+
487
+
488
+
References
489
+
----------
490
+
491
+
.. [2] M. Cuturi, Sinkhorn Distances : Lightspeed Computation of Optimal Transport, Advances in Neural Information Processing Systems (NIPS) 26, 2013
492
+
[22] J. Altschuler, J.Weed, P. Rigollet : Near-linear time approximation algorithms for optimal transport via Sinkhorn iteration, Advances in Neural Information Processing Systems (NIPS) 31, 2017
493
+
494
+
495
+
See Also
496
+
--------
497
+
ot.lp.emd : Unregularized OT
498
+
ot.optim.cg : General regularized OT
499
+
500
+
"""
501
+
502
+
n=a.shape[0]
503
+
m=b.shape[0]
504
+
505
+
# Next 3 lines equivalent to K= np.exp(-M/reg), but faster to compute
0 commit comments