def action_space(self): return Box(low=-abs(self.env_params["max_break"]), high=self.env_params["max_torque"], shape=(self.num_trucks - 1, ))
def __init__(self, env=None): super(FlashRescale, self).__init__(env) self.observation_space = Box(0, 255, [128, 200, 1])
def action_space(self): num_actions = self.initial_vehicles.num_rl_vehicles accel_ub = self.env_params.additional_params["max_accel"] accel_lb = -abs(self.env_params.additional_params["max_decel"]) return Box(low=accel_lb, high=accel_ub, shape=(num_actions, ))
def __init__(self, env, env_conf): gym.ObservationWrapper.__init__(self, env) self.observation_space = Box(0.0, 1.0, [1, 80, 80]) self.conf = env_conf
def __init__(self, env=None): super(MyAtariRescale42x42, self).__init__(env) self.observation_space = Box(0.0, 1.0, [1, 42, 42])
def __init__(self, full_episode=False): super(CarRacingWrapper, self).__init__() self.full_episode = full_episode self.observation_space = Box(low=0, high=255, shape=(SCREEN_X, SCREEN_Y, 3))
def action_space(self): """See class definition.""" return Box(low=-abs(self.env_params.additional_params["max_decel"]), high=self.env_params.additional_params["max_accel"], shape=(self.num_rl, ), dtype=np.float32)
def observation_space(self): return Box(low=-1, high=1, shape=(7 * self.num_rl, ), dtype=np.float32)
def observation_space(self): return Box(low=float('-inf'), high=float('inf'), shape=(6 * self.num_rl, ), dtype=np.float32)
def __init__(self, env, env_conf): gym.ObservationWrapper.__init__(self, env) self.observation_space = Box(0.0, 1.0, [80, 80, 1], dtype=np.uint8) self.conf = env_conf
def observation_space(self): return Box(low=0, high=255, shape=(self.size, self.size, self.frame_skip), dtype=np.uint8)
def observation_space(self): """See class definition.""" return Box(low=-float("inf"), high=float("inf"), shape=(1, ), dtype=np.float32)
def action_space(self): return Box(low=0, high=1, shape=(self.num_traffic_lights, ), dtype=np.float32)
def observation_space(self): return Box(low=0, high=1, shape=(3 * self.num_trucks - 1,))
def observation_space(self): return Box(low=-float("inf"), high=float("inf"), shape=(1,), dtype=np.float32)
def box(): return Box(low=np.array([1.2, 256, -8, -2]), high=np.array([1.5, 1024, -4, 8]))
def __init__(self, env=None): super(WrapPyTorch, self).__init__(env) self.observation_space = Box(0.0, 1.0, [1, 84, 84])
def __init__(self, env=None, obs_height=160, obs_width=160): super(WobRescale, self).__init__(env) self.obs_height = obs_height self.obs_width = obs_width self.observation_space = Box(0.0, 1.0, [obs_height, obs_width, 1])
def observation_space(self): """See class definition.""" return Box(low=-1, high=1, shape=(5 * self.num_rl, ), dtype=np.float32)
def observation_space(self): """See class definition.""" return Box(low=0, high=1, shape=(3,), dtype=np.float32)
def __init__(self, env=None): super(AddTimestep, self).__init__(env) self.observation_space = Box(self.observation_space.low[0], self.observation_space.high[0], [self.observation_space.shape[0] + 1], dtype=self.observation_space.dtype)
def observation_space(self): # Return the observation space adjusted to match the shape of the processed # observations. c = 1 if self.gray_scale else 3 shape = self.image_size + (c, ) return Box(low=0, high=255, shape=shape, dtype=np.uint8)
def __init__(self, env=None): super(AtariProcessing, self).__init__(env) self.observation_space = Box(0.0, 1.0, [42, 42, 1])
def __init__(self, env=None): super(AtariRescale84x84Env, self).__init__(env) self.observation_space = Box(0, 255, [84, 84, 1])
def __init__(self, env=None): super(AtariRescale42x42, self).__init__(env) self.observation_space = Box(0, 255, [42, 42, 1])
def __init__(self, env, env_conf): gym.ObservationWrapper.__init__(self, env) self.observation_space = Box(0, 255, [1, 84, 84], dtype=np.uint8) self.conf = env_conf
env = MixedEnv() env.seed(100) return env return _thunk return SubprocVecEnv([make_env()]) if __name__ == '__main__': sess = tf_util.make_session() restores = [] navigation_model = LstmPolicy(sess, Box(low=0, high=255, shape=(84, 84, 12), dtype=np.uint8), Discrete(3), 1, 1, reuse=False, model_name='navi') navigation_params = find_trainable_variables('navi') navigation_loaded = joblib.load( 'O:\\Doom\\a2c\\scenarios\\display\\navi.dat') for p, loaded_p in zip(navigation_params, navigation_loaded): restores.append(p.assign(loaded_p)) shoot_model = LstmPolicy(sess, Box(low=0, high=255,
def __init__(self, env=None): super(ScaleObservations, self).__init__(env) self.obs_lo = self.observation_space.low[0,0,0] self.obs_hi = self.observation_space.high[0,0,0] obs_shape = self.observation_space.shape self.observation_space = Box(0.0, 1.0, obs_shape, dtype=np.float32)
def observation_space(self): return Box( low=0, high=float("inf"), shape=(2 * self.initial_vehicles.num_vehicles, ), )
def __init__(self, env=None): super(AtariRescale84x84, self).__init__(env) self.observation_space = Box(0.0, 1.0, [3, 84, 84])