From d82e6eb1af99a982a4934d6bc019a9ab4ad5c880 Mon Sep 17 00:00:00 2001 From: Alex Tong Date: Thu, 5 Mar 2020 12:05:16 -0500 Subject: Fix convolutional_barycenter kernel for non-symmetric images Add authorship --- ot/bregman.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ot/bregman.py') diff --git a/ot/bregman.py b/ot/bregman.py index 2707b7c..d5e3563 100644 --- a/ot/bregman.py +++ b/ot/bregman.py @@ -9,6 +9,7 @@ Bregman projections for regularized OT # Titouan Vayer # Hicham Janati # Mokhtar Z. Alaya +# Alexander Tong # # License: MIT License @@ -1346,12 +1347,17 @@ def convolutional_barycenter2d(A, reg, weights=None, numItermax=10000, err = 1 # build the convolution operator + # this is equivalent to blurring on horizontal then vertical directions t = np.linspace(0, 1, A.shape[1]) [Y, X] = np.meshgrid(t, t) xi1 = np.exp(-(X - Y)**2 / reg) + t = np.linspace(0, 1, A.shape[2]) + [Y, X] = np.meshgrid(t, t) + xi2 = np.exp(-(X - Y)**2 / reg) + def K(x): - return np.dot(np.dot(xi1, x), xi1) + return np.dot(np.dot(xi1, x), xi2) while (err > stopThr and cpt < numItermax): -- cgit v1.2.3