The following imports NumPy and sets the seed.
import numpy as np
np.random.seed(42)
However, I'm not interested in setting the seed but more in reading it. random.get_state()
does not seem to contain the seed. The documentation doesn't show an obvious answer.
How do I retrieve the current seed used by numpy.random
, assuming I did not set it manually?
I want to use the current seed to carry over for the next iteration of a process.
Aucun commentaire:
Enregistrer un commentaire