Ejemplo n.º 1
0
def main():
    """Main."""
    # env initialization
    env = gym.make("Pong-v0")

    # set a random seed
    common_utils.set_random_seed(args.seed, env)

    # run
    module_path = "examples.pong_v0." + args.algo
    example = importlib.import_module(module_path)
    example.run(env, args)
def main():
    """Main."""
    # env initialization
    env_name = "PongNoFrameskip-v4"
    env = atari_env_generator(env_name, args.max_episode_steps)

    # set a random seed
    common_utils.set_random_seed(args.seed, env)

    # run
    module_path = "examples.pong_no_frameskip_v4." + args.algo
    example = importlib.import_module(module_path)
    example.run(env, env_name, args)
Ejemplo n.º 3
0
def main():
    """Main."""
    # env initialization
    env = gym.make("Reacher-v1")
    state_dim = env.observation_space.shape[0]
    action_dim = env.action_space.shape[0]

    # set a random seed
    common_utils.set_random_seed(args.seed, env)

    # run
    module_path = "examples.reacher-v1." + args.algo
    example = importlib.import_module(module_path)
    example.run(env, args, state_dim, action_dim)
Ejemplo n.º 4
0
def main():
    """Main."""
    # env initialization
    env = gym.make("LunarLanderContinuous-v2")
    state_dim = env.observation_space.shape[0]
    action_dim = env.action_space.shape[0]

    # set a random seed
    common_utils.set_random_seed(args.seed, env)

    # run
    module_path = "examples.lunarlander_continuous_v2." + args.algo
    example = importlib.import_module(module_path)
    example.run(env, args, state_dim, action_dim)
Ejemplo n.º 5
0
def main():
    """Main."""
    # env initialization
    env = gym.make("LunarLander-v2")
    env_utils.set_env(env, args)
    state_dim = env.observation_space.shape[0]
    action_dim = env.action_space.n  # 0: none 1: left 2: engine 3: right

    # set a random seed
    common_utils.set_random_seed(args.seed, env)

    # run
    module_path = "examples.lunarlander_v2." + args.algo
    example = importlib.import_module(module_path)
    example.run(env, args, state_dim, action_dim)
Ejemplo n.º 6
0
def main():
    # env initialization
    env_name = "FCTP-v1"
    env = env_generator_FCTP(env_name, 100000)  # max_episode_steps
    env_utils.set_env(env, args)
    env.set_comp(False)  # True for two component actions, False for one

    # set a random seed
    common_utils.set_random_seed(args.seed, env)

    # run
    module_path = "fctp_v1." + args.algo  # Set agent type from algo argument from cmd line

    example = importlib.import_module(module_path)
    example.run(env, env_name, args)
def main():
    """Main."""
    # env initialization
    env = gym.make("LunarLanderContinuous-v2")
    # set a random seed
    common_utils.set_random_seed(args.seed, env)

    # run
    module_path = "config.agent.lunarlander_continuous_v2." + args.algo
    agent = importlib.import_module(module_path)
    agent = agent.get(env, args)

    # run
    if args.test:
        agent.test()
    else:
        agent.train()
def main():
    """Main."""
    # env initialization
    env = OpenManipulatorReacherEnv(env_cfg)

    # set a random seed
    common_utils.set_random_seed(args.seed, env)

    # agent initialization
    module_path = "config.agent.open_manipulator_reacher_v0." + args.algo
    agent = importlib.import_module(module_path)
    agent = agent.get(env, args)

    # run
    if args.test:
        agent.test()
    else:
        agent.train()
Ejemplo n.º 9
0
def main():
    """Main."""
    # env initialization
    env = gym.make("Reacher-v1")

    # set a random seed
    common_utils.set_random_seed(args.seed, env)

    # agent initialization
    module_path = "config.agent.reacher-v1." + args.algo
    agent = importlib.import_module(module_path)
    agent = agent.get(env, args)

    # run
    if args.test:
        agent.test()
    else:
        agent.train()