Skip to content

Commit 85a0d5b

Browse files
fix pep8 and tests
1 parent 917b445 commit 85a0d5b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ot/gromov/_gw.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def df(G):
167167
return 0.5 * (gwggrad(constC, hC1, hC2, G, np_) + gwggrad(constCt, hC1t, hC2t, G, np_))
168168

169169
# removed since 0.9.2
170-
#if loss_fun == 'kl_loss':
170+
# if loss_fun == 'kl_loss':
171171
# armijo = True # there is no closed form line-search with KL
172172

173173
if armijo:
@@ -479,7 +479,7 @@ def df(G):
479479
return 0.5 * (gwggrad(constC, hC1, hC2, G, np_) + gwggrad(constCt, hC1t, hC2t, G, np_))
480480

481481
# removed since 0.9.2
482-
#if loss_fun == 'kl_loss':
482+
# if loss_fun == 'kl_loss':
483483
# armijo = True # there is no closed form line-search with KL
484484

485485
if armijo:
@@ -828,7 +828,7 @@ def gromov_barycenters(
828828
C = init_C
829829

830830
# removed since 0.9.2
831-
#if loss_fun == 'kl_loss':
831+
# if loss_fun == 'kl_loss':
832832
# armijo = True
833833

834834
cpt = 0
@@ -1015,7 +1015,7 @@ def fgw_barycenters(
10151015
T = [nx.outer(p, q) for q in ps]
10161016

10171017
# removed since 0.9.2
1018-
#if loss_fun == 'kl_loss':
1018+
# if loss_fun == 'kl_loss':
10191019
# armijo = True
10201020

10211021
cpt = 0

test/test_gromov.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ def test_fgw_barycenter(nx):
14311431
alpha=0.5, fixed_structure=True, init_C=None, fixed_features=False,
14321432
p=None, loss_fun='square_loss', max_iter=100, tol=1e-3
14331433
)
1434-
except:
1434+
except ot.utils.UndefinedParameter:
14351435
Xb, Cb = ot.gromov.fgw_barycenters(
14361436
n_samples, [ysb, ytb], [C1b, C2b], ps=[p1b, p2b], lambdas=None,
14371437
alpha=0.5, fixed_structure=True, init_C=init_Cb, fixed_features=False,
@@ -1451,7 +1451,7 @@ def test_fgw_barycenter(nx):
14511451
p=pb, loss_fun='square_loss', max_iter=100, tol=1e-3,
14521452
warmstartT=True, log=True, random_state=98765, verbose=True
14531453
)
1454-
except:
1454+
except ot.utils.UndefinedParameter:
14551455
Xb, Cb, logb = ot.gromov.fgw_barycenters(
14561456
n_samples, [ysb, ytb], [C1b, C2b], [p1b, p2b], [.5, .5], 0.5,
14571457
fixed_structure=False, fixed_features=True, init_X=init_Xb,

0 commit comments

Comments
 (0)