b7db501d7e0b8404f13be86ed6bcc96f2da5861f,slm_lab/agent/memory/replay.py,Replay,__init__,#Replay#Any#,32
Before Change
self.actions = np.zeros((self.max_size, self.action_dim))
self.rewards = np.zeros((self.max_size, 1))
self.next_states = np.zeros((self.max_size, self.state_dim))
self.dones = np.zeros((self.max_size, 1))
self.priorities = np.zeros((self.max_size, 1))
self.true_size = 0
self.head = -1 // Index of most recent experience
After Change
self.action_dim = self.body.action_dim
self.batch_idxs = None
self.total_experiences = 0 // to know total size even with forgetting
self.reset()
def reset(self):
self.states = np.zeros((self.max_size, self.state_dim))
self.actions = np.zeros((self.max_size, self.action_dim))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: kengz/SLM-Lab
Commit Name: b7db501d7e0b8404f13be86ed6bcc96f2da5861f
Time: 2018-01-16
Author: kengzwl@gmail.com
File Name: slm_lab/agent/memory/replay.py
Class Name: Replay
Method Name: __init__
Project Name: victoresque/pytorch-template
Commit Name: 102123eef25500a39160412eca7e8cb9f53104a6
Time: 2019-09-10
Author: SunQ0313@gmail.com
File Name: trainer/trainer.py
Class Name: Trainer
Method Name: _train_epoch
Project Name: victoresque/pytorch-template
Commit Name: 102123eef25500a39160412eca7e8cb9f53104a6
Time: 2019-09-10
Author: SunQ0313@gmail.com
File Name: trainer/trainer.py
Class Name: Trainer
Method Name: _valid_epoch