-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于环境初始化的一点提示 #73
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
0.26.0以上版本的gym对一些函数做出了改动,这一点在 #50 有被提到过,并给出了修改方法:
# env.seed(0)
改为env.reset(seed=0)
state = env.reset()
下一行添加一行state = state[0]
next_state, reward, done, _ = env.step(action)
等号左边添加一个, _
,即新版函数增加了一个输出Originally posted by @wulidede in #50 (comment)
注意到
env.reset()
除了在定义环境的时候使用过,在训练过程中也有所涉及,因此第7、8、9章代码的训练部分,以及rl_utils.py
中的对应部分也要改为env.reset(seed=0)
。修改后,在CartPole-v0环境中的训练结果更好,且结果固定。如图:The text was updated successfully, but these errors were encountered: