environment/build.py
def build_nes_environment(
    image_size: tuple=(84, 84),
    clip_rewards: bool=True, # sigmoid
    agent_history_length: int=4,
    monitor_dir: str=None
):
    """
    Build and return a configured NES environment.

    Args:
        image_size: the size to down-sample images to
        clip_rewards: whether to clip rewards in {-1, 0, +1}
        agent_history_length: the size of the frame buffer for the agent
        monitor_dir: the directory to save monitor info to if any

    Returns:
        a gym environment configured for this experiment

    """
                                # SuperMarioBros-1-1-v0
    env = gym_super_mario_bros.make('SuperMarioBros-v0')
    # add a reward cache for scoring episodes
    env = RewardChace(env)
    # apply a down-sampler for the given game
    env = DownsampleEnv(env, image_size)
    # clip the rewards in {-1, 0, +1} if the feature is enabled
    if clip_rewards:
        env = ClipRewardEnv(env)
    # apply the back history of frames if the feature is enabled
    if agent_history_length is not None:
        env = FrameStackEnv(env, agent_history_length)

    return env

    Build and return a configured NES environment.

    Args:
        image_size: the size to down-sample images to
        clip_rewards: whether to clip rewards in {-1, 0, +1}
        agent_history_length: the size of the frame buffer for the agent
        monitor_dir: the directory to save monitor info to if any

    Returns:
        a gym environment configured for this experiment

    
Build and return a configured NES environment.
Build and return a configured NES environment .
def build_nes_environment(
    image_size: tuple=(84, 84),
    clip_rewards: bool=True, 
    agent_history_length: int=4,
    monitor_dir: str=None
):
    env = gym_super_mario_bros.make('SuperMarioBros-v0')
    env = RewardChace(env)
    env = DownsampleEnv(env, image_size)
    if clip_rewards:
        env = ClipRewardEnv(env)
    if agent_history_length is not None:
        env = FrameStackEnv(env, agent_history_length)
    return env
def build_nes_environment ( image_size : tuple = ( 84 , 84 ) , clip_rewards : bool = True , agent_history_length : int = 4 , monitor_dir : str = None ) : env = gym_super_mario_bros . make ( 'SuperMarioBros-v0' ) env = RewardChace ( env ) env = DownsampleEnv ( env , image_size ) if clip_rewards : env = ClipRewardEnv ( env ) if agent_history_length is not None : env = FrameStackEnv ( env , agent_history_length ) return env
Build and return a configured NES environment.
Build and return a configured NES environment .
# sigmoid """
    Build and return a configured NES environment.

    Args:
        image_size: the size to down-sample images to
        clip_rewards: whether to clip rewards in {-1, 0, +1}
        agent_history_length: the size of the frame buffer for the agent
        monitor_dir: the directory to save monitor info to if any

    Returns:
        a gym environment configured for this experiment

    """ # SuperMarioBros-1-1-v0 # add a reward cache for scoring episodes # apply a down-sampler for the given game # clip the rewards in {-1, 0, +1} if the feature is enabled # apply the back history of frames if the feature is enabled
a gym environment configured for this experiment
a gym environment configured for this experiment
image_size
tuple
the size to down-sample images to
the size to down - sample images to
clip_rewards
bool
whether to clip rewards in {-1, 0, +1}
whether to clip rewards in { - 1 0 + 1 }
agent_history_length
int
the size of the frame buffer for the agent
the size of the frame buffer for the agent
monitor_dir
str
the directory to save monitor info to if any
the directory to save monitor info to if any