mardi 18 avril 2023

Size of seeds for numpy.random

I want to run some code using numpy.random and keep track of what the seed is so that if the output is interesting, I can recreate and play around with that randomly generated instance. Therefore, I want the setup to involve something like

import numpy as np
s = np.random.randint(10000000000)
print(s)
np.random.seed(s)
### remainder of code

so that the code is still running randomly, but I also have retained the seed s. The value 10000000000 was chosen arbitrarily; what is the appropriate scale for numpy.random's seeding? e.g. are seeds all the same modulo 2^32?




Aucun commentaire:

Enregistrer un commentaire