{"action":"opened","issue":{"url":"https://api.github.com/repos/matthiasplappert/keras-rl/issues/29","repository_url":"https://api.github.com/repos/matthiasplappert/keras-rl","labels_url":"https://api.github.com/repos/matthiasplappert/keras-rl/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/matthiasplappert/keras-rl/issues/29/comments","events_url":"https://api.github.com/repos/matthiasplappert/keras-rl/issues/29/events","html_url":"https://github.com/matthiasplappert/keras-rl/issues/29","id":180676805,"number":29,"title":"CDQN reset_states error","user":{"login":"RyanHope","id":141005,"avatar_url":"https://avatars.githubusercontent.com/u/141005?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanHope","html_url":"https://github.com/RyanHope","followers_url":"https://api.github.com/users/RyanHope/followers","following_url":"https://api.github.com/users/RyanHope/following{/other_user}","gists_url":"https://api.github.com/users/RyanHope/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanHope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanHope/subscriptions","organizations_url":"https://api.github.com/users/RyanHope/orgs","repos_url":"https://api.github.com/users/RyanHope/repos","events_url":"https://api.github.com/users/RyanHope/events{/privacy}","received_events_url":"https://api.github.com/users/RyanHope/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-03T15:53:48Z","updated_at":"2016-10-03T15:53:48Z","closed_at":null,"body":"The CDQN agent doesn't have self.model so the call to self.model.reset_states() super call errors out. This fix seems to work:\r\n\r\n```\r\ndiff --git a/rl/agents/dqn.py b/rl/agents/dqn.py\r\nindex b607689..31d0966 100644\r\n--- a/rl/agents/dqn.py\r\n+++ b/rl/agents/dqn.py\r\n@@ -410,7 +410,8 @@ class ContinuousDQNAgent(DQNAgent):\r\n         self.combined_model.save_weights(filepath, overwrite=overwrite)\r\n\r\n     def reset_states(self):\r\n-        super(ContinuousDQNAgent, self).reset_states()\r\n+        self.recent_action = None\r\n+        self.recent_observations = deque(maxlen=self.window_length)\r\n         if self.compiled:\r\n             self.combined_model.reset_states()\r\n```"}}
{"actor":{"display_login":"RyanHope"}}