def __init__(self, env: Env): """Initialize. :param env: gym environment to wrap. """ ObservationWrapper.__init__(self, env) space = env.observation_space assert len(space) == 2, "Expected: environment state, automata states" assert type(space[0]) == Discrete, "Env state must be discrete" assert type(space[1]) == MultiDiscrete, "Automata states are discrete" self.observation_space = MultiDiscrete( (np.insert(space[1].nvec, 0, space[0].n)))
def __init__(self, env: Env): """Initialize. :param env: gym environment to wrap. """ ObservationWrapper.__init__(self, env) space = env.observation_space assert len(space) == 2, "Expected: environment state, automata states" assert type(space[0]) == Box, "Env state must be a box" assert type(space[1]) == MultiDiscrete, "Automata states are discrete" automata_highs = space[1].nvec.astype(np.float32) automata_lows = np.zeros_like(automata_highs) automata_box = Box(automata_lows, automata_highs) self.observation_space = combine_boxes(space[0], automata_box)
def __init__(self, env): ObservationWrapper.__init__(self, env) self.observation_space = spaces.Box( low=0.0, high=1.0, shape=(84, 84), dtype=np.float32)
def __init__(self, env): ObservationWrapper.__init__(self, env) # Important so that gym's play.py picks up the right resolution self.observation_space = spaces.Box(low=0, high=255, shape=(84, 84), dtype=np.uint8)
def __init__(self, env): ObservationWrapper.__init__(self, env) self.frames_since_reset = None