@@ -358,10 +358,11 @@ class TestTP:
358
358
"""
359
359
360
360
def setup_method (self ):
361
- X = np .random .randn (20 , 3 )
362
- y = np .random .randn (20 )
363
- Xnew = np .random .randn (30 , 3 )
364
- pnew = np .random .randn (30 )
361
+ rng = np .random .default_rng (20221125 )
362
+ X = rng .standard_normal (size = (20 , 3 ))
363
+ y = rng .standard_normal (size = (20 ,))
364
+ Xnew = rng .standard_normal (size = (30 , 3 ))
365
+ pnew = rng .standard_normal (size = (30 ,))
365
366
366
367
with pm .Model () as model1 :
367
368
cov_func = pm .gp .cov .ExpQuad (3 , [0.1 , 0.2 , 0.3 ])
@@ -414,6 +415,7 @@ class TestLatentKron:
414
415
"""
415
416
416
417
def setup_method (self ):
418
+ rng = np .random .default_rng (20221125 )
417
419
self .Xs = [
418
420
np .linspace (0 , 1 , 7 )[:, None ],
419
421
np .linspace (0 , 1 , 5 )[:, None ],
@@ -422,9 +424,13 @@ def setup_method(self):
422
424
self .X = cartesian (* self .Xs )
423
425
self .N = np .prod ([len (X ) for X in self .Xs ])
424
426
self .y = np .random .randn (self .N ) * 0.1
425
- self .Xnews = (np .random .randn (5 , 1 ), np .random .randn (5 , 1 ), np .random .randn (5 , 1 ))
427
+ self .Xnews = (
428
+ rng .standard_normal (size = (5 , 1 )),
429
+ rng .standard_normal (size = (5 , 1 )),
430
+ rng .standard_normal (size = (5 , 1 )),
431
+ )
426
432
self .Xnew = np .concatenate (self .Xnews , axis = 1 )
427
- self .pnew = np . random . randn ( len (self .Xnew ))
433
+ self .pnew = rng . standard_normal ( size = ( len (self .Xnew ), ))
428
434
ls = 0.2
429
435
with pm .Model () as latent_model :
430
436
self .cov_funcs = (
0 commit comments