def make_atari_env(name, seed): from gym.envs.atari.atari_env import AtariEnv env = AtariEnv(game=name, frameskip=4, obs_type='image') env = monitor(env, name) env = wrap_deepmind(env) env.seed(seed) return env
def make_atari_env(name, seed): from gym.wrappers.monitor import Monitor from gym.envs.atari.atari_env import AtariEnv env = AtariEnv(game=name, frameskip=4, obs_type='image') env = Monitor(env, 'videos/', force=True, video_callable=lambda e: False) env = wrappers.wrap_deepmind(env) env.seed(seed) return env
def make_atari_env(name, history_len): from gym.envs.atari.atari_env import AtariEnv from gym.wrappers.monitor import Monitor env = AtariEnv(game=name, frameskip=4, obs_type='image') env = Monitor(env, 'videos/', force=True, video_callable=lambda e: False) env = wrappers.wrap_deepmind(env) env = wrappers.HistoryWrapper(env, history_len) env.seed(utils.random_seed()) return env
def make(game, size=84, grayscale=True, history_len=4): env = AtariEnv(game, frameskip=4, obs_type='image') env = envs.make.monitor(env, game) if 'FIRE' in env.unwrapped.get_action_meanings(): env = FireResetWrapper(env) env = NoopResetWrapper(env) env = EpisodicLifeWrapper(env) env = ClippedRewardWrapper(env) env = PreprocessedImageWrapper(env, size, grayscale) if history_len > 1: env = HistoryWrapper(env, history_len) return env
import tensorflow as tf import numpy as np import gym from gym.envs.atari.atari_env import AtariEnv env_name = 'pong' # env_name = 'HalfCheetah-v1' # env_name = 'Swimmer-v1' # env_name = 'Hopper-v1' # env_name = 'Humanoid-v1' # env_name = 'HumanoidStandup-v1' # env_name = 'BipedalWalker-v2' # env = gym.make(env_name) env = AtariEnv(game='breakout', obs_type="ram", frameskip=10) env.reset() while (1): env.render()
def create_env(cls, config): return AtariEnv( game=config.game, obs_type='image', frameskip=config.frameskip, repeat_action_probability=config.repeat_action_probability)