From 67f429e3de21d16f0ddaddfb52556d3d1e71bd30 Mon Sep 17 00:00:00 2001 From: Oleksii Kachaiev Date: Fri, 5 May 2023 23:44:55 +0200 Subject: [PATCH 1/2] np -> nx for stabilized barycenters log --- ot/bregman.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ot/bregman.py b/ot/bregman.py index 4503ffcfd..29bcd5867 100644 --- a/ot/bregman.py +++ b/ot/bregman.py @@ -1898,8 +1898,8 @@ def barycenter_stabilized(A, M, reg, tau=1e10, weights=None, numItermax=1000, "Or a larger absorption threshold `tau`.") if log: log['niter'] = ii - log['logu'] = np.log(u + 1e-16) - log['logv'] = np.log(v + 1e-16) + log['logu'] = nx.log(u + 1e-16) + log['logv'] = nx.log(v + 1e-16) return q, log else: return q From 04eb0b92ed54e5f7f22abfc33135ee8b020999c5 Mon Sep 17 00:00:00 2001 From: Oleksii Kachaiev Date: Fri, 5 May 2023 23:52:14 +0200 Subject: [PATCH 2/2] Mention fix in RELEASES --- RELEASES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASES.md b/RELEASES.md index 02fddad91..97f4c4478 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -15,6 +15,7 @@ - Fix gradients for "Wasserstein2 Minibatch GAN" example (PR #466) - Faster Bures-Wasserstein distance with NumPy backend (PR #468) - Fix issue backend for ot.sliced_wasserstein_sphere ot.sliced_wasserstein_sphere_unif (PR #471) +- Fix issue with ot.barycenter_stabilized when used with PyTorch tensors and log=True (RP #474) ## 0.9.0