MCPcopy Create free account
hub / github.com/YeWR/EfficientZero / reset

Method reset

core/utils.py:114–125  ·  view source on GitHub ↗

Reset only when lives are exhausted. This way all states are still reachable even though lives are episodic, and the learner need not know about any of this behind-the-scenes.

(self, **kwargs)

Source from the content-addressed store, hash-verified

112 return obs, reward, done, info
113
114 def reset(self, **kwargs):
115 """Reset only when lives are exhausted.
116 This way all states are still reachable even though lives are episodic,
117 and the learner need not know about any of this behind-the-scenes.
118 """
119 if self.was_real_done:
120 obs = self.env.reset(**kwargs)
121 else:
122 # no-op step to advance from terminal/lost life state
123 obs, _, _, _ = self.env.step(0)
124 self.lives = self.env.unwrapped.ale.lives()
125 return obs
126
127
128class MaxAndSkipEnv(gym.Wrapper):

Callers

nothing calls this directly

Calls 2

resetMethod · 0.45
stepMethod · 0.45

Tested by

no test coverage detected