11
11
12
12
13
13
def test_gromov ():
14
- np .random .seed (42 )
15
-
16
14
n_samples = 50 # nb samples
17
15
18
16
mu_s = np .array ([0 , 0 ])
19
17
cov_s = np .array ([[1 , 0 ], [0 , 1 ]])
20
18
21
- xs = ot .datasets .make_2D_samples_gauss (n_samples , mu_s , cov_s )
19
+ xs = ot .datasets .make_2D_samples_gauss (n_samples , mu_s , cov_s , random_state = 4 )
22
20
23
21
xt = xs [::- 1 ].copy ()
24
22
@@ -58,14 +56,12 @@ def test_gromov():
58
56
59
57
60
58
def test_entropic_gromov ():
61
- np .random .seed (42 )
62
-
63
59
n_samples = 50 # nb samples
64
60
65
61
mu_s = np .array ([0 , 0 ])
66
62
cov_s = np .array ([[1 , 0 ], [0 , 1 ]])
67
63
68
- xs = ot .datasets .make_2D_samples_gauss (n_samples , mu_s , cov_s )
64
+ xs = ot .datasets .make_2D_samples_gauss (n_samples , mu_s , cov_s , random_state = 42 )
69
65
70
66
xt = xs [::- 1 ].copy ()
71
67
@@ -102,13 +98,11 @@ def test_entropic_gromov():
102
98
103
99
104
100
def test_gromov_barycenter ():
105
- np .random .seed (42 )
106
-
107
101
ns = 50
108
102
nt = 60
109
103
110
- Xs , ys = ot .datasets .make_data_classif ('3gauss' , ns )
111
- Xt , yt = ot .datasets .make_data_classif ('3gauss2' , nt )
104
+ Xs , ys = ot .datasets .make_data_classif ('3gauss' , ns , random_state = 42 )
105
+ Xt , yt = ot .datasets .make_data_classif ('3gauss2' , nt , random_state = 42 )
112
106
113
107
C1 = ot .dist (Xs )
114
108
C2 = ot .dist (Xt )
@@ -131,12 +125,11 @@ def test_gromov_barycenter():
131
125
132
126
133
127
def test_gromov_entropic_barycenter ():
134
- np .random .seed (42 )
135
128
ns = 50
136
129
nt = 60
137
130
138
- Xs , ys = ot .datasets .make_data_classif ('3gauss' , ns )
139
- Xt , yt = ot .datasets .make_data_classif ('3gauss2' , nt )
131
+ Xs , ys = ot .datasets .make_data_classif ('3gauss' , ns , random_state = 42 )
132
+ Xt , yt = ot .datasets .make_data_classif ('3gauss2' , nt , random_state = 42 )
140
133
141
134
C1 = ot .dist (Xs )
142
135
C2 = ot .dist (Xt )
@@ -159,14 +152,13 @@ def test_gromov_entropic_barycenter():
159
152
160
153
161
154
def test_fgw ():
162
- np .random .seed (42 )
163
155
164
156
n_samples = 50 # nb samples
165
157
166
158
mu_s = np .array ([0 , 0 ])
167
159
cov_s = np .array ([[1 , 0 ], [0 , 1 ]])
168
160
169
- xs = ot .datasets .make_2D_samples_gauss (n_samples , mu_s , cov_s )
161
+ xs = ot .datasets .make_2D_samples_gauss (n_samples , mu_s , cov_s , random_state = 42 )
170
162
171
163
xt = xs [::- 1 ].copy ()
172
164
@@ -217,8 +209,8 @@ def test_fgw_barycenter():
217
209
ns = 50
218
210
nt = 60
219
211
220
- Xs , ys = ot .datasets .make_data_classif ('3gauss' , ns )
221
- Xt , yt = ot .datasets .make_data_classif ('3gauss2' , nt )
212
+ Xs , ys = ot .datasets .make_data_classif ('3gauss' , ns , random_state = 42 )
213
+ Xt , yt = ot .datasets .make_data_classif ('3gauss2' , nt , random_state = 42 )
222
214
223
215
ys = np .random .randn (Xs .shape [0 ], 2 )
224
216
yt = np .random .randn (Xt .shape [0 ], 2 )
0 commit comments