Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
    def __init__(self, env, color=False):
        """A gym wrapper that crops, scales image into the desired shapes and optionally grayscales it."""
        ObservationWrapper.__init__(self, env)

        self.color = color
        self.img_size = (1, 64, 64)
        self.observation_space = Box(0.0, 1.0, (1, 64, 64))
Exemplo n.º 3
0
    def __init__(self, env, height=42, width=42, margins=[1, 1, 1, 1]):
        """A gym wrapper that crops, scales image into the desired shapes and grayscales it."""
        ObservationWrapper.__init__(self, env)

        self.img_size = (1, width, height)
        self.desired_img_size = (width, height)
        self.margins = margins
        self.observation_space = Box(0.0, 1.0, self.img_size)
Exemplo n.º 4
0
 def __init__(self, env):
     ObservationWrapper.__init__(self, env)
     # Important so that gym's play.py picks up the right resolution
     obs_shape = env.observation_space.shape
     assert len(obs_shape) == 3  # height, width, n_stack
     self.observation_space = spaces.Box(low=0, high=255,
                                         shape=(obs_shape[0], obs_shape[1] * obs_shape[2]),
                                         dtype=np.uint8)
Exemplo n.º 5
0
    def __init__(self, env, reset_listener):
        ObservationWrapper.__init__(self, env=env)

        self.reset_listener = reset_listener

        self.last_e_steps = 0
        self.episodes = 1
        self.observations_list = []
    def __init__(self, env):
        """
        preprocess environment observation shape
        """
        ObservationWrapper.__init__(self, env)

        self.shape = (60, 60)
        self.observation_space = Box(0.0, 1.0,
                                     (self.shape[0], self.shape[1], 1))
Exemplo n.º 7
0
    def __init__(self, env, model_dir, save_frequency_steps):
        ObservationWrapper.__init__(self, env=env)

        self.save_frequency_steps = save_frequency_steps
        self.total_steps = 0
        self.total_steps_save_counter = 0
        self.total_episodes = 0

        self.model_dir = model_dir
Exemplo n.º 8
0
    def __init__(self, env, model_dir, save_frequency_steps):
        ObservationWrapper.__init__(self, env=env)

        self.save_frequency_steps = save_frequency_steps
        self.total_steps = 0
        self.total_steps_save_counter = 0
        self.total_episodes = 0
        self.str_time_start = time.strftime("%Y%m%d-%H%M")

        self.model_dir = model_dir
Exemplo n.º 9
0
 def __init__(self, env, img_size = (84, 84, 1)):
     ObservationWrapper.__init__(self, env)
     self.img_size = img_size
     if not self.img_size:
         self.img_size = (env.observation_space.shape[0],
                          env.observation_space.shape[1],
                          1)
                          
     self.observation_space = Box(0.0, 1.0, self.img_size
                                  , dtype=np.float32)
Exemplo n.º 10
0
 def __init__(self, env):
     ObservationWrapper.__init__(self, env)
     self.frames_since_reset = None
Exemplo n.º 11
0
 def __init__(self, env):
     ObservationWrapper.__init__(self, env)
     self.observation_space = spaces.Box(low=0.0,
                                         high=1.0,
                                         shape=env.observation_space.shape,
                                         dtype=np.float32)
Exemplo n.º 12
0
    def __init__(self, env):
        """A gym wrapper that crops, scales image into the desired shapes and grayscales it."""
        ObservationWrapper.__init__(self, env)

        self.image_size = (1, 64, 64)
        self.observation_space = Box(0.0, 1.0, self.image_size)
Exemplo n.º 13
0
 def __init__(self, env):
     ObservationWrapper.__init__(self, env)
     self.unwrapped.observation_space = Box(-np.inf, np.inf, (7, ))
Exemplo n.º 14
0
    def __init__(self, env):
        """A gym wrapper that crops, scales image into the desired shapes and optionally grayscales it."""
        ObservationWrapper.__init__(self, env)

        self.img_size = (64, 64)
        self.observation_space = Box(0.0, 1.0, (self.img_size[0], self.img_size[1], 1))