Пример #1
0
 def action_space(self):
     return Box(low=-abs(self.env_params["max_break"]),
                high=self.env_params["max_torque"],
                shape=(self.num_trucks - 1, ))
Пример #2
0
 def __init__(self, env=None):
     super(FlashRescale, self).__init__(env)
     self.observation_space = Box(0, 255, [128, 200, 1])
Пример #3
0
    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, ))
Пример #4
0
 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
Пример #5
0
 def __init__(self, env=None):
     super(MyAtariRescale42x42, self).__init__(env)
     self.observation_space = Box(0.0, 1.0, [1, 42, 42])
Пример #6
0
 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))
Пример #7
0
 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)
Пример #8
0
 def observation_space(self):
     return Box(low=-1, high=1, shape=(7 * self.num_rl, ), dtype=np.float32)
Пример #9
0
 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
Пример #11
0
 def observation_space(self):
     return Box(low=0,
                high=255,
                shape=(self.size, self.size, self.frame_skip),
                dtype=np.uint8)
Пример #12
0
 def observation_space(self):
     """See class definition."""
     return Box(low=-float("inf"),
                high=float("inf"),
                shape=(1, ),
                dtype=np.float32)
Пример #13
0
 def action_space(self):
     return Box(low=0,
                high=1,
                shape=(self.num_traffic_lights, ),
                dtype=np.float32)
Пример #14
0
 def observation_space(self):
     return Box(low=0, high=1, shape=(3 * self.num_trucks - 1,))
Пример #15
0
 def observation_space(self):
     return Box(low=-float("inf"), high=float("inf"), shape=(1,),
                dtype=np.float32)
Пример #16
0
def box():
    return Box(low=np.array([1.2, 256, -8, -2]),
               high=np.array([1.5, 1024, -4, 8]))
Пример #17
0
 def __init__(self, env=None):
     super(WrapPyTorch, self).__init__(env)
     self.observation_space = Box(0.0, 1.0, [1, 84, 84])
Пример #18
0
 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])
Пример #19
0
 def observation_space(self):
     """See class definition."""
     return Box(low=-1, high=1, shape=(5 * self.num_rl, ), dtype=np.float32)
Пример #20
0
 def observation_space(self):
     """See class definition."""
     return Box(low=0, high=1, shape=(3,), dtype=np.float32)
Пример #21
0
 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)
Пример #22
0
 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)
Пример #23
0
 def __init__(self, env=None):
     super(AtariProcessing, self).__init__(env)
     self.observation_space = Box(0.0, 1.0, [42, 42, 1])
Пример #24
0
 def __init__(self, env=None):
     super(AtariRescale84x84Env, self).__init__(env)
     self.observation_space = Box(0, 255, [84, 84, 1])
Пример #25
0
 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
Пример #27
0
            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,
Пример #28
0
 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)
Пример #29
0
 def observation_space(self):
     return Box(
         low=0,
         high=float("inf"),
         shape=(2 * self.initial_vehicles.num_vehicles, ),
     )
Пример #30
0
 def __init__(self, env=None):
     super(AtariRescale84x84, self).__init__(env)
     self.observation_space = Box(0.0, 1.0, [3, 84, 84])