@@ -969,6 +969,9 @@ def _iter_sample(
969
969
if draws < 1 :
970
970
raise ValueError ("Argument `draws` must be greater than 0." )
971
971
972
+ if random_seed is not None :
973
+ np .random .seed (random_seed )
974
+
972
975
try :
973
976
step = CompoundStep (step )
974
977
except TypeError :
@@ -1229,6 +1232,9 @@ def _prepare_iter_population(
1229
1232
if draws < 1 :
1230
1233
raise ValueError ("Argument `draws` should be above 0." )
1231
1234
1235
+ if random_seed is not None :
1236
+ np .random .seed (random_seed )
1237
+
1232
1238
# The initialization of traces, samplers and points must happen in the right order:
1233
1239
# 1. population of points is created
1234
1240
# 2. steppers are initialized and linked to the points object
@@ -2511,7 +2517,7 @@ def init_nuts(
2511
2517
cov = approx .std .eval () ** 2
2512
2518
potential = quadpotential .QuadPotentialDiag (cov )
2513
2519
elif init == "advi_map" :
2514
- start = pm .find_MAP (include_transformed = True )
2520
+ start = pm .find_MAP (include_transformed = True , seed = seeds [ 0 ] )
2515
2521
approx = pm .MeanField (model = model , start = start )
2516
2522
pm .fit (
2517
2523
random_seed = seeds [0 ],
@@ -2526,7 +2532,7 @@ def init_nuts(
2526
2532
cov = approx .std .eval () ** 2
2527
2533
potential = quadpotential .QuadPotentialDiag (cov )
2528
2534
elif init == "map" :
2529
- start = pm .find_MAP (include_transformed = True )
2535
+ start = pm .find_MAP (include_transformed = True , seed = seeds [ 0 ] )
2530
2536
cov = pm .find_hessian (point = start )
2531
2537
initial_points = [start ] * chains
2532
2538
potential = quadpotential .QuadPotentialFull (cov )
0 commit comments