I am just wondering if the user can set a random seed so it could reproduce all game states for testing purpose. Is it possible to support it if there is no such feature? Thanks!
Yes, envs in gym expose a seed() function for exactly this purpose e.g.
>>> import gym
>>> env = gym.make('CartPole-v0')
>>> env.seed(0)
This could be documented better.
@jietang Thanks! I also wonder if env.reset() will reset the seed that I previously set. For example,
import gym
env = gym.make('CartPole-v0')
env.seed(0)
# reset the environment.
env.reset()
# Then the random seed is still 0 or not?
In this case, does reset() reset seed as well?
Hopefully not, otherwise the agent would always train on the same scenario.
(Correct, it does not.)
On Sat, Jul 30, 2016 at 3:39 PM, Danijar Hafner [email protected]
wrote:
Hopefully not, otherwise the agent would always train on the same scenario.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/openai/gym/issues/250#issuecomment-236393754, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAM7kSn_8X85UwEEKnVq_EkEQyfrAxeeks5qa9KmgaJpZM4JP_vq
.
Most helpful comment
Yes, envs in gym expose a seed() function for exactly this purpose e.g.
This could be documented better.