8c17debc9dc6552da8c317c0c852b55f03c80c61,slm_lab/agent/__init__.py,Agent,reset,#Agent#Any#,53
Before Change
"""Do agent reset per episode, such as memory pointer"""
self.memory.reset_last_state(state)
// TODO hack add
if hasattr(self, "memory_1"):
self.memory_1.reset_last_state(state)
def act(self, state):
"""Standard act method from algorithm."""
return self.algorithm.act(state)
After Change
def reset(self, state_a):
"""Do agent reset per episode, such as memory pointer"""
for (e, b), body in util.ndenumerate_nonan(self.body_a):
body.memory.reset_last_state(state_a[(e, b)])
def act(self, state_a):
"""Standard act method from algorithm."""
action_a = self.algorithm.act(state_a)
return action_a
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances Project Name: kengz/SLM-Lab
Commit Name: 8c17debc9dc6552da8c317c0c852b55f03c80c61
Time: 2017-12-24
Author: kengzwl@gmail.com
File Name: slm_lab/agent/__init__.py
Class Name: Agent
Method Name: reset
Project Name: kengz/SLM-Lab
Commit Name: 2381a50a70559340a0335288d648b4bb9a675588
Time: 2018-06-12
Author: kengzwl@gmail.com
File Name: slm_lab/agent/algorithm/dqn.py
Class Name: MultitaskDQN
Method Name: act
Project Name: kengz/SLM-Lab
Commit Name: 8c17debc9dc6552da8c317c0c852b55f03c80c61
Time: 2017-12-24
Author: kengzwl@gmail.com
File Name: slm_lab/agent/__init__.py
Class Name: Agent
Method Name: update