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

terminal in agent.py seem not handle properly #60

Open
martin6336 opened this issue Sep 23, 2018 · 1 comment
Open

terminal in agent.py seem not handle properly #60

martin6336 opened this issue Sep 23, 2018 · 1 comment

Comments

@martin6336
Copy link

`

for self.step in tqdm(range(start_step, self.max_step), ncols=70, initial=start_step):

if self.step == self.learn_start:
    num_game, self.update_count, ep_reward = 0, 0, 0.
    total_reward, self.total_loss, self.total_q = 0., 0., 0.
    ep_rewards, actions = [], []

# 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)

if terminal:
    screen, reward, action, terminal = self.env.new_random_game()
    num_game += 1
    ep_rewards.append(ep_reward)
    ep_reward = 0.

`
Function train in agent.py may not handle properly when the game is terminated. As the game is terminated, the new screen didn't add into history and memory, self.history isn't get updated. And in the next iteration, action = self.predict(self.history.get()) will be the same, i.e. terminated.

@douglasrizzo
Copy link

Maybe your issue is related to #48 and #59

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