lrpg_cartpole.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:cartpoleplusplus 作者: matpalm 项目源码 文件源码
def rollout(self, doing_eval=False):
    """ run one episode collecting observations, actions and advantages"""
    observations, actions, rewards = [], [], []
    observation = self.env.reset()
    done = False
    while not done:
      observations.append(observation)
      action = self.sample_action_given(observation, doing_eval)
      assert action != 5, "FAIL! (multinomial logits sampling bug?"
      observation, reward, done, _ = self.env.step(action)
      actions.append(action)
      rewards.append(reward)
    if VERBOSE_DEBUG:
      print "rollout: actions=%s" % (actions)
    return observations, actions, rewards
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号