Beispiel #1
0
def create_env(env_name, flags):
    if env_name.startswith('Coin'):
        from coinrun import coinrunenv
        from coinrun import setup_utils as coinrun_setup_utils
        coinrun_setup_utils.setup_and_load(
            use_cmd_line_args=False,
            set_statics=flags.set_statics,
            set_dynamics=flags.set_dynamics,
            num_levels=flags.num_levels,
            any_custom_game=flags.any_custom_game,
            use_pytorch=True,
            paint_vel_info=0,
            is_high_res=flags.is_high_res,
            default_zoom=flags.default_zoom,
            float_obs=False)  # torchbeast divides by 255
        return CoinRunOneEnv('platform',
                             1,
                             default_zoom=flags.default_zoom,
                             float_obs=False)
    else:
        return atari_wrappers.wrap_pytorch(
            atari_wrappers.wrap_deepmind(atari_wrappers.make_atari(env_name),
                                         clip_rewards=False,
                                         frame_stack=True,
                                         scale=False))
Beispiel #2
0
def create_env(flags):
    return atari_wrappers.wrap_pytorch(
        atari_wrappers.wrap_deepmind(
            atari_wrappers.make_atari(flags.env),
            clip_rewards=False,
            frame_stack=True,
            scale=False,
        ))
def create_env(env_name, lock=threading.Lock()):
    with lock:  # Atari isn't threadsafe at construction time.
        return atari_wrappers.wrap_pytorch(
            atari_wrappers.wrap_deepmind(
                atari_wrappers.make_atari(env_name),
                clip_rewards=False,
                frame_stack=True,
                scale=False,
            ))
def create_env(env_name, full_action_space=False):
    return atari_wrappers.wrap_pytorch(
        atari_wrappers.wrap_deepmind(
            atari_wrappers.make_atari(env_name,
                                      full_action_space=full_action_space),
            clip_rewards=False,
            frame_stack=True,
            scale=False,
        ))
Beispiel #5
0
def create_env(flags):
    return atari_wrappers.wrap_pytorch(
        atari_wrappers.wrap_deepmind(
            atari_wrappers.make_atari(flags.env),
            clip_rewards=False,
            frame_stack=True,
            scale=False,
            # The masking environment handles grayscaling itself
            grayscale='Masked' not in flags.env,
        )
    )
Beispiel #6
0
def create_env(flags):
    if flags.env_type == 'mujoco':
        return Multi2SingleWrapper(gym.make(flags.env))
    else:
        assert flags.env_type == 'atari'
    return atari_wrappers.wrap_pytorch(
        atari_wrappers.wrap_deepmind(
            atari_wrappers.make_atari(flags.env),
            clip_rewards=False,
            frame_stack=True,
            scale=False,
        ))
def create_env(env,
               frame_height=84,
               frame_width=84,
               gray_scale=True,
               full_action_space=False,
               task=0):
    return atari_wrappers.wrap_pytorch_task(atari_wrappers.wrap_deepmind(
        atari_wrappers.make_atari(env, full_action_space=full_action_space),
        clip_rewards=False,
        frame_stack=True,
        frame_height=frame_height,
        frame_width=frame_width,
        gray_scale=gray_scale,
        scale=False,
    ),
                                            task=task)
Beispiel #8
0
def create_env(env_name, lock=threading.Lock()):
    with lock:  # Atari isn't threadsafe at construction time.
        return atari_wrappers.wrap_pytorch(
            atari_wrappers.wrap_interp(atari_wrappers.make_atari(flags.env), ))
Beispiel #9
0
def create_env(flags):
    return atari_wrappers.wrap_pytorch(
        atari_wrappers.wrap_interp(atari_wrappers.make_atari(flags.env), ))