88a4755619f157339b0f90a4ac5bf3e4e083679f,ch09/04_pong_pg.py,MeanRingBuf,__init__,#MeanRingBuf#Any#,33
Before Change
class MeanRingBuf:
def __init__(self, capacity):
self.capacity = capacity
self.full = False
self.pos = 0
self._buf = np.zeros((capacity, ), dtype=np.float32)
def add(self, val):
self._buf[self.pos] = val
self.pos = (self.pos + 1) % self.capacity
After Change
class MeanBuffer:
def __init__(self, capacity):
self.capacity = capacity
self.deque = collections.deque(maxlen=capacity)
self.sum = 0.0
def add(self, val):
if len(self.deque) == self.capacity:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 88a4755619f157339b0f90a4ac5bf3e4e083679f
Time: 2017-12-08
Author: max.lapan@gmail.com
File Name: ch09/04_pong_pg.py
Class Name: MeanRingBuf
Method Name: __init__
Project Name: openai/baselines
Commit Name: 9b68103b737ac46bc201dfb3121cfa5df2127e53
Time: 2019-05-08
Author: peterzhokhoff@gmail.com
File Name: baselines/common/atari_wrappers.py
Class Name: WarpFrame
Method Name: __init__
Project Name: openai/baselines
Commit Name: b875fb7b5e4feb85b9f1f1bf4e78f64c75595664
Time: 2019-02-27
Author: peterzhokhoff@gmail.com
File Name: baselines/common/tests/envs/mnist_env.py
Class Name: MnistEnv
Method Name: __init__