Reputation: 85
I find out all of the reinforcement learning algorithms need to set the env.seed(#) in the first hand, I would like to know the reason behind it.
Thank you very much!
Upvotes: 2
Views: 2316
Reputation: 241
All the gym environments I've worked with have used numpy's random number generator. You certainly don't need to seed it yourself, as it will fall back to seeding on the current clock time. Seeds are specified manually whenever you're concerned about reproducibility. If you don't give your RNG the same seed, it will produce a different sequence of random numbers. Since machine learning is so empirically-driven, reproducibility is incredibly important.
Upvotes: 3