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

Method __init__

rl3/a2c/atari_wrappers.py:10–18  ·  view source on GitHub ↗

Sample initial states by taking random number of no-ops on reset. No-op is assumed to be action 0.

(self, env, noop_max=30)

Source from the content-addressed store, hash-verified

8
9class NoopResetEnv(gym.Wrapper):
10 def __init__(self, env, noop_max=30):
11 """Sample initial states by taking random number of no-ops on reset.
12 No-op is assumed to be action 0.
13 """
14 gym.Wrapper.__init__(self, env)
15 self.noop_max = noop_max
16 self.override_num_noops = None
17 self.noop_action = 0
18 assert env.unwrapped.get_action_meanings()[0] == 'NOOP'
19
20 def reset(self, **kwargs):
21 """ Do no-op action for a number of steps in [1, noop_max]."""

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected