MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / __init__

Method __init__

rl3/a2c/atari_wrappers.py:170–183  ·  view source on GitHub ↗

Stack k last frames. Returns lazy array, which is much more memory efficient. See Also -------- baselines.common.atari_wrappers.LazyFrames

(self, env, k)

Source from the content-addressed store, hash-verified

168
169class FrameStack(gym.Wrapper):
170 def __init__(self, env, k):
171 """Stack k last frames.
172
173 Returns lazy array, which is much more memory efficient.
174
175 See Also
176 --------
177 baselines.common.atari_wrappers.LazyFrames
178 """
179 gym.Wrapper.__init__(self, env)
180 self.k = k
181 self.frames = deque([], maxlen=k)
182 shp = env.observation_space.shape
183 self.observation_space = spaces.Box(low=0, high=255, shape=(shp[0], shp[1], shp[2] * k))
184
185 def reset(self):
186 ob = self.env.reset()

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected