MCPcopy Create free account
hub / github.com/rlcode/reinforcement-learning / __init__

Method __init__

3-atari/1-dqn.py:62–70  ·  view source on GitHub ↗
(self, capacity, frame_shape=(84, 84), stack=4)

Source from the content-addressed store, hash-verified

60 cutting RAM ~4x vs. storing the full stack per slot."""
61
62 def __init__(self, capacity, frame_shape=(84, 84), stack=4):
63 self.capacity = capacity
64 self.stack = stack
65 self.frames = np.zeros((capacity, *frame_shape), dtype=np.uint8)
66 self.actions = np.zeros(capacity, dtype=np.int64)
67 self.rewards = np.zeros(capacity, dtype=np.float32)
68 self.dones = np.zeros(capacity, dtype=np.float32)
69 self.idx = 0
70 self.size = 0
71
72 def push(self, frame, action, reward, done):
73 self.frames[self.idx] = frame

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected