Commit 3f05b530 authored by Richard A Hofer's avatar Richard A Hofer Committed by Yuxin Wu

Remove assumption that history is 4 frames in expreplay. (#268)

* Remove assumption that history is 4 frames in expreplay.

* fix linting
parent 0fc880b7
...@@ -173,12 +173,8 @@ class ExpReplay(DataFlow, Callback): ...@@ -173,12 +173,8 @@ class ExpReplay(DataFlow, Callback):
def _populate_exp(self): def _populate_exp(self):
""" populate a transition by epsilon-greedy""" """ populate a transition by epsilon-greedy"""
# if len(self.mem) > 4 and not self._init_memory_flag.is_set():
# from copy import deepcopy # quickly fill the memory for debug
# self.mem.append(deepcopy(self.mem._hist[0]))
# return
old_s = self.player.current_state() old_s = self.player.current_state()
if self.rng.rand() <= self.exploration or len(self.mem) < 5: if self.rng.rand() <= self.exploration or (len(self.mem) <= self.history_len):
act = self.rng.choice(range(self.num_actions)) act = self.rng.choice(range(self.num_actions))
else: else:
# build a history state # build a history state
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment