Conversation
|
Travis CI failed due to style checks. Can you install |
|
Fixed the style. Thanks. |
|
Thanks for the fixes. Can you add tests for SumTree, PrioritizedBuffer and Prioritized(Episodic)ReplayBuffer? |
chainerrl/agents/dqn.py
Outdated
| for _ in episodes: | ||
| errors_out.append(0.0) | ||
| errors_out_step = [] | ||
| # print('----------------------------------------------------') |
There was a problem hiding this comment.
Can you remove comment-outed code like this?
chainerrl/misc/prioritized.py
Outdated
| self.data = [] | ||
| self.priority_tree = SumTree() | ||
| self.data_inf = collections.deque() | ||
| self.count_used = [] |
There was a problem hiding this comment.
What is the purpose of self.count_used?
There was a problem hiding this comment.
Sorry. count_used was not used.
|
I tried adding this test case to |
tests/test_replay_buffer.py
Outdated
| self.assertEqual(s2[1], trans1) | ||
|
|
||
|
|
||
| class PrioritizedReplayBuffer(unittest.TestCase): |
There was a problem hiding this comment.
Can you rename it to TestPrioritizedReplayBuffer to avoid confusion?
|
Fixed the issue on capacity. The argument 'capacity' of PrioritizedBuffer was used to limit len(self.data). Now, it limits len(self) (= len(self.data) + len(self.data_inf)). |
chainerrl/misc/prioritized.py
Outdated
| self.priority_tree[i] = self.priority_tree[n-1] | ||
| del self.priority_tree[n-1] | ||
| ret = self.data[i] | ||
| self.data[i] = self.data.pop() |
There was a problem hiding this comment.
self.data[i] = self.data.pop()
This would raise an out-of-range error if i == n - 1 because self.data has only n-1 elements after pop.
|
The example script fails. Can you fix it? |
|
Changes Unknown when pulling 4cec485 on toslunar:prioritized-replay into ** on pfnet:master**. |
|
Changes Unknown when pulling 620fb17 on toslunar:prioritized-replay into ** on pfnet:master**. |
|
Changes Unknown when pulling b6ca346 on toslunar:prioritized-replay into ** on pfnet:master**. |
|
Changes Unknown when pulling b6ca346 on toslunar:prioritized-replay into ** on pfnet:master**. |
|
Thanks for the fixes! Now it looks good. |
Prioritized replay (for DQN)