Skip to content

Commit 08e5c0a

Browse files
author
Vivien Seguy
committed
add test free support barycenter algorithm + cleaning
1 parent 4671279 commit 08e5c0a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

examples/plot_free_support_barycenter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
# Compute free support barycenter
4949
# -------------
5050

51-
k = 10 # number of Diracs of the barycenter
52-
X_init = np.random.normal(0., 1., (k, d)) # initial Dirac locations
53-
b = np.ones((k,)) / k # weights of the barycenter (it will not be optimized, only the locations are optimized)
51+
k = 10 # number of Diracs of the barycenter
52+
X_init = np.random.normal(0., 1., (k, d)) # initial Dirac locations
53+
b = np.ones((k,)) / k # weights of the barycenter (it will not be optimized, only the locations are optimized)
5454

5555
X = ot.lp.free_support_barycenter(measures_locations, measures_weights, X_init, b)
5656

test/test_ot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ def test_lp_barycenter():
137137

138138
def test_free_support_barycenter():
139139

140-
measures_locations = [np.array([-1.]).reshape((1,1)), np.array([1.]).reshape((1,1))]
140+
measures_locations = [np.array([-1.]).reshape((1, 1)), np.array([1.]).reshape((1, 1))]
141141
measures_weights = [np.array([1.]), np.array([1.])]
142142

143-
X_init = np.array([-12.]).reshape((1,1))
143+
X_init = np.array([-12.]).reshape((1, 1))
144144

145145
# obvious barycenter location between two diracs
146-
bar_locations = np.array([0.]).reshape((1,1))
146+
bar_locations = np.array([0.]).reshape((1, 1))
147147

148148
X = ot.lp.free_support_barycenter(measures_locations, measures_weights, X_init)
149149

0 commit comments

Comments
 (0)