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
- :math:`\mathbf{m}_j` is the jth column of the cost matrix
424
+
- :math:`\delta_\Omega` is the convex conjugate of the regularization term :math:`\Omega`
425
+
- a and b are source and target weights (sum to 1)
426
+
427
+
The OT matrix can is reconstructed from the gradient of :math:`\delta_\Omega`
428
+
(See [17]_ Proposition 1).
429
+
The optimization algorithm is using gradient decent (L-BFGS by default).
430
+
431
+
432
+
Parameters
433
+
----------
434
+
a : np.ndarray (ns,)
435
+
samples weights in the source domain
436
+
b : np.ndarray (nt,) or np.ndarray (nt,nbb)
437
+
samples in the target domain, compute sinkhorn with multiple targets
438
+
and fixed M if b is a matrix (return OT loss + dual variables in log)
439
+
M : np.ndarray (ns,nt)
440
+
loss matrix
441
+
reg : float
442
+
Regularization term >0
443
+
reg_type : str
444
+
Regularization type, can be the following (default ='l2'):
445
+
- 'kl' : Kullback Leibler (~ Neg-entropy used in sinkhorn [2]_)
446
+
- 'l2' : Squared Euclidean regularization
447
+
method : str
448
+
Solver to use for scipy.optimize.minimize
449
+
numItermax : int, optional
450
+
Max number of iterations
451
+
stopThr : float, optional
452
+
Stop threshol on error (>0)
453
+
verbose : bool, optional
454
+
Print information along iterations
455
+
log : bool, optional
456
+
record log if True
457
+
458
+
459
+
Returns
460
+
-------
461
+
gamma : (ns x nt) ndarray
462
+
Optimal transportation matrix for the given parameters
463
+
log : dict
464
+
log dictionary return only if log==True in parameters
465
+
466
+
467
+
References
468
+
----------
469
+
470
+
.. [2] M. Cuturi, Sinkhorn Distances : Lightspeed Computation of Optimal Transport, Advances in Neural Information Processing Systems (NIPS) 26, 2013
471
+
472
+
.. [17] Blondel, M., Seguy, V., & Rolet, A. (2018). Smooth and Sparse Optimal Transport. Proceedings of the Twenty-First International Conference on Artificial Intelligence and Statistics (AISTATS).
- :math:`\mathbf{m}_j` is the jth column of the cost matrix
519
+
- :math:`OT_\Omega^*(\alpha,b)` is defined in Eq. (9) in [17]
520
+
- a and b are source and target weights (sum to 1)
521
+
522
+
The OT matrix can is reconstructed using [17]_ Proposition 2.
523
+
The optimization algorithm is using gradient decent (L-BFGS by default).
524
+
525
+
526
+
Parameters
527
+
----------
528
+
a : np.ndarray (ns,)
529
+
samples weights in the source domain
530
+
b : np.ndarray (nt,) or np.ndarray (nt,nbb)
531
+
samples in the target domain, compute sinkhorn with multiple targets
532
+
and fixed M if b is a matrix (return OT loss + dual variables in log)
533
+
M : np.ndarray (ns,nt)
534
+
loss matrix
535
+
reg : float
536
+
Regularization term >0
537
+
reg_type : str
538
+
Regularization type, can be the following (default ='l2'):
539
+
- 'kl' : Kullback Leibler (~ Neg-entropy used in sinkhorn [2]_)
540
+
- 'l2' : Squared Euclidean regularization
541
+
method : str
542
+
Solver to use for scipy.optimize.minimize
543
+
numItermax : int, optional
544
+
Max number of iterations
545
+
stopThr : float, optional
546
+
Stop threshol on error (>0)
547
+
verbose : bool, optional
548
+
Print information along iterations
549
+
log : bool, optional
550
+
record log if True
551
+
552
+
553
+
Returns
554
+
-------
555
+
gamma : (ns x nt) ndarray
556
+
Optimal transportation matrix for the given parameters
557
+
log : dict
558
+
log dictionary return only if log==True in parameters
559
+
560
+
561
+
References
562
+
----------
563
+
564
+
.. [2] M. Cuturi, Sinkhorn Distances : Lightspeed Computation of Optimal Transport, Advances in Neural Information Processing Systems (NIPS) 26, 2013
565
+
566
+
.. [17] Blondel, M., Seguy, V., & Rolet, A. (2018). Smooth and Sparse Optimal Transport. Proceedings of the Twenty-First International Conference on Artificial Intelligence and Statistics (AISTATS).
567
+
568
+
See Also
569
+
--------
570
+
ot.lp.emd : Unregularized OT
571
+
ot.sinhorn : Entropic regularized OT
572
+
ot.optim.cg : General regularized OT
573
+
574
+
"""
436
575
ifreg_type.lower() in ['l2', 'squaredl2']:
437
576
regul=SquaredL2(gamma=reg)
438
577
elifreg_type.lower() in ['entropic', 'negentropy', 'kl']:
0 commit comments