6ffeec9a0f8627a9965026249e68cab643435f79,examples/ale/train_dqn_ale.py,,main,#,65

Before Change


    print("Output files are saved in {}".format(args.outdir))

    // In training, life loss is considered as terminal states
    env = ale.ALE(args.rom, use_sdl=args.use_sdl, seed=train_seed)
    misc.env_modifiers.make_reward_clipped(env, -1, 1)
    // In testing, an episode is terminated  when all lives are lost
    eval_env = ale.ALE(args.rom, use_sdl=args.use_sdl,
                       treat_life_lost_as_terminal=False,
                       seed=test_seed)

    n_actions = env.number_of_actions
    activation = parse_activation(args.activation)
    q_func = parse_arch(args.arch, n_actions, activation)

    // Draw the computational graph and save it in the output directory.

After Change


                        choices=["DQN", "DoubleDQN", "PAL"])
    parser.add_argument("--logging-level", type=int, default=20,
                        help="Logging level. 10:DEBUG, 20:INFO etc.")
    args = parser.parse_args()

    import logging
    logging.basicConfig(level=args.logging_level)

    // Set a random seed used in ChainerRL.
    misc.set_random_seed(args.seed, gpus=(args.gpu,))

    // Set different random seeds for train and test envs.
    train_seed = args.seed
    test_seed = 2 ** 31 - 1 - args.seed

    args.outdir = experiments.prepare_output_dir(args, args.outdir)
    print("Output files are saved in {}".format(args.outdir))

    // In training, life loss is considered as terminal states
    env = gym.make(args.env)
    env.seed(train_seed)
    env = atari_wrappers.wrap_deepmind(env)

    // In testing, an episode is terminated  when all lives are lost
    eval_env = gym.make(args.env)
    eval_env.seed(test_seed)
    eval_env = atari_wrappers.wrap_deepmind(
        eval_env, episode_life=False, clip_rewards=False)

    n_actions = env.action_space.n
    activation = parse_activation(args.activation)
    q_func = parse_arch(args.arch, n_actions, activation)

    // Draw the computational graph and save it in the output directory.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: chainer/chainerrl
Commit Name: 6ffeec9a0f8627a9965026249e68cab643435f79
Time: 2018-03-21
Author: muupan@gmail.com
File Name: examples/ale/train_dqn_ale.py
Class Name:
Method Name: main


Project Name: chainer/chainerrl
Commit Name: 457b3fa3bc641bc47c1948e03d81ce2a47f24d7a
Time: 2018-04-20
Author: muupan@gmail.com
File Name: examples/ale/train_acer_ale.py
Class Name:
Method Name: main


Project Name: chainer/chainerrl
Commit Name: 6ffeec9a0f8627a9965026249e68cab643435f79
Time: 2018-03-21
Author: muupan@gmail.com
File Name: examples/ale/train_c51_ale.py
Class Name:
Method Name: main


Project Name: chainer/chainerrl
Commit Name: 6ffeec9a0f8627a9965026249e68cab643435f79
Time: 2018-03-21
Author: muupan@gmail.com
File Name: examples/ale/train_dqn_ale.py
Class Name:
Method Name: main