113c1d84a806358d5c9f1242a88edb3966a304ab,ch09/04_pong_pg.py,,,#,47

Before Change


    parser.add_argument("--cuda", default=False, action="store_true", help="Enable cuda")
    args = parser.parse_args()

    envs = [make_env() for _ in range(5)]
    writer = SummaryWriter(comment="-pong-pg")

    net = common.AtariPGN(envs[0].observation_space.shape, envs[0].action_space.n)
    if args.cuda:
        net.cuda()
    print(net)

    agent = ptan.agent.PolicyAgent(net, apply_softmax=True, cuda=args.cuda)
    exp_source = ptan.experience.ExperienceSourceFirstLast(envs, agent, gamma=GAMMA, steps_count=REWARD_STEPS)

    optimizer = optim.Adam(net.parameters(), lr=LEARNING_RATE, eps=1e-3)

    total_rewards = []
    step_rewards = MeanRingBuf(capacity=BASELINE_STEPS)

After Change


    parser.add_argument("--cuda", default=False, action="store_true", help="Enable cuda")
    args = parser.parse_args()

    env = make_env()
    writer = SummaryWriter(comment="-pong-pg")

    net = common.AtariPGN(env.observation_space.shape, env.action_space.n)
    if args.cuda:
        net.cuda()
    print(net)

    agent = ptan.agent.PolicyAgent(net, apply_softmax=True, cuda=args.cuda)
    exp_source = ptan.experience.ExperienceSourceFirstLast(env, agent, gamma=GAMMA, steps_count=REWARD_STEPS)

    optimizer = optim.Adam(net.parameters(), lr=LEARNING_RATE, eps=1e-3)

    total_rewards = []
    step_rewards = MeanRingBuf(capacity=BASELINE_STEPS)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 23

Instances


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 113c1d84a806358d5c9f1242a88edb3966a304ab
Time: 2017-12-05
Author: max.lapan@gmail.com
File Name: ch09/04_pong_pg.py
Class Name:
Method Name:


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 9205eee4cbfb730ea37c3e81a797698983fd6e87
Time: 2017-12-06
Author: max.lapan@gmail.com
File Name: ch09/05_pong_a2c.py
Class Name:
Method Name:


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 433fcf96eda8e924652c4a67878f6636e533b649
Time: 2017-12-07
Author: max.lapan@gmail.com
File Name: ch09/04_pong_pg.py
Class Name:
Method Name: