From c4228594e21a7166b2b6fadbb13397c5d5668513 Mon Sep 17 00:00:00 2001 From: FerdinandGns <56926826+FerdinandGns@users.noreply.github.com> Date: Mon, 16 Mar 2020 22:22:32 +0100 Subject: [PATCH 1/2] Update bregman.py --- ot/bregman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ot/bregman.py b/ot/bregman.py index d5e35638a..f1b3484f0 100644 --- a/ot/bregman.py +++ b/ot/bregman.py @@ -1120,7 +1120,7 @@ def barycenter_sinkhorn(A, M, reg, weights=None, numItermax=1000, err = 1 UKv = np.dot(K, np.divide(A.T, np.sum(K, axis=0)).T) - u = (geometricMean(UKv) / UKv.T).T + u = (geometricBar(UKv,weights) / UKv.T).T while (err > stopThr and cpt < numItermax): cpt = cpt + 1 From 72174fa74c77f673f90fb3a470b20a089e01bb0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Mon, 22 Jun 2020 10:51:52 +0200 Subject: [PATCH 2/2] correct call to function --- ot/bregman.py | 2 +- ot/optim.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ot/bregman.py b/ot/bregman.py index 154db2f9a..457bdd44b 100644 --- a/ot/bregman.py +++ b/ot/bregman.py @@ -1116,7 +1116,7 @@ def barycenter_sinkhorn(A, M, reg, weights=None, numItermax=1000, err = 1 UKv = np.dot(K, np.divide(A.T, np.sum(K, axis=0)).T) - u = (geometricBar(UKv,weights) / UKv.T).T + u = (geometricBar(weights, UKv) / UKv.T).T while (err > stopThr and cpt < numItermax): cpt = cpt + 1 diff --git a/ot/optim.py b/ot/optim.py index b9ca8918b..a32b240bb 100644 --- a/ot/optim.py +++ b/ot/optim.py @@ -136,7 +136,7 @@ def solve_linesearch(cost, G, deltaG, Mi, f_val, def cg(a, b, M, reg, f, df, G0=None, numItermax=200, numItermaxEmd=100000, stopThr=1e-9, stopThr2=1e-9, verbose=False, log=False, **kwargs): - """ + r""" Solve the general regularized OT problem with conditional gradient The function solves the following optimization problem: @@ -275,7 +275,7 @@ def cost(G): def gcg(a, b, M, reg1, reg2, f, df, G0=None, numItermax=10, numInnerItermax=200, stopThr=1e-9, stopThr2=1e-9, verbose=False, log=False): - """ + r""" Solve the general regularized OT problem with the generalized conditional gradient The function solves the following optimization problem: @@ -413,7 +413,7 @@ def cost(G): def solve_1d_linesearch_quad(a, b, c): - """ + r""" For any convex or non-convex 1d quadratic function f, solve on [0,1] the following problem: .. math:: \argmin f(x)=a*x^{2}+b*x+c