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

Class StickyActionEnv

4-atari-hard/env_robustify.py:40–57  ·  view source on GitHub ↗

repeat_action_probability applied BELOW frameskip — sticky at the raw action level, the standard v5 stochasticity. We build the ALE env with sticky 0 and add it here so the demo replay (which must be deterministic) can bypass it.

Source from the content-addressed store, hash-verified

38
39
40class StickyActionEnv:
41 """repeat_action_probability applied BELOW frameskip — sticky at the raw
42 action level, the standard v5 stochasticity. We build the ALE env with
43 sticky 0 and add it here so the demo replay (which must be deterministic)
44 can bypass it."""
45
46 def __init__(self, p=0.25):
47 self.p = p
48 self.last = 0
49
50 def reset(self):
51 self.last = 0
52
53 def filter(self, action, rng):
54 if rng.random() < self.p:
55 return self.last
56 self.last = action
57 return action
58
59
60class ReplayResetEnv:

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected