Python numpy - Reproducibility of random numbers -
we have simple program (single-threaded) we bunch of random sample generation. using several calls of numpy
random functions (like normal
or random_sample
). result of 1 random call determines number of times random function called.
now want set seed in beginning s.th. multiple runs of program should yield same result. i'm using instance of numpy
class randomstate
. while case in beginning, @ time results become different , why i'm wondering.
when doing correctly, having no concurrency , thereby linear call of functions , no other random number generator involded, why not work?
okay, david right. prngs in numpy work correctly. throughout every minimal example created, worked supposed to.
my problem different one, solved it. never loop on dictionary within deterministic algorithm. seems python orders items arbitrarily when calling .item() function getting in iterator.
so not disappointed this kind of error, because useful reminder of think when trying reproducible simulations.