Skip to content
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

about starting a new game and History #59

Open
Richardxxxxxxx opened this issue Sep 12, 2018 · 1 comment
Open

about starting a new game and History #59

Richardxxxxxxx opened this issue Sep 12, 2018 · 1 comment

Comments

@Richardxxxxxxx
Copy link

in dqn/agent.py line 59

  if terminal:
    screen, reward, action, terminal = self.env.new_random_game()

when starting a new game due to a terminal state.

why we don't need to reset the self.history?

because it would affect the next iteration.

  # 1. predict
  action = self.predict(self.history.get())
  # 2. act
  screen, reward, terminal = self.env.act(action, is_training=True)
  # 3. observe
  self.observe(screen, reward, action, terminal)

the predicted action for self.history.get() is not depending on the current game screens, it will predict action for the previous game screen, which is ended, instead.

Do I miss anything?

Thank you very much.

@hipoglucido
Copy link

Yeah, it would affect the next iteration, but it won't do any harm in most of the cases. In many RL environments the concept of episode/game is abstracted away from the agent and all it sees is a continuous flow of millions of frames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants