ca907342507c1139696f542de0a3351d7a382eee,reinforcement_learning/actor_critic.py,,,#,86

Before Change




running_reward = 10
for i_episode in count(1):
    state = env.reset()
    for t in range(10000):  // Don"t infinite loop while learning
        action = select_action(state)
        state, reward, done, _ = env.step(action)
        if args.render:
            env.render()
        model.rewards.append(reward)
        if done:
            break

    running_reward = running_reward * 0.99 + t * 0.01
    finish_episode()
    if i_episode % args.log_interval == 0:
        print("Episode {}\tLast length: {:5d}\tAverage length: {:.2f}".format(
            i_episode, t, running_reward))
    if running_reward > env.spec.reward_threshold:
        print("Solved! Running reward is now {} and "
              "the last episode runs to {} time steps!".format(running_reward, t))
        break

After Change


            break


if __name__ == "__main__":
    main()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: pytorch/examples
Commit Name: ca907342507c1139696f542de0a3351d7a382eee
Time: 2017-12-04
Author: sgross@fb.com
File Name: reinforcement_learning/actor_critic.py
Class Name:
Method Name:


Project Name: openai/baselines
Commit Name: 6c44fb28fecdb666182e2951b7b1cbe9cf198ff1
Time: 2018-12-19
Author: peterzhokhoff@gmail.com
File Name: baselines/her/rollout.py
Class Name: RolloutWorker
Method Name: generate_rollouts


Project Name: pytorch/examples
Commit Name: ca907342507c1139696f542de0a3351d7a382eee
Time: 2017-12-04
Author: sgross@fb.com
File Name: reinforcement_learning/reinforce.py
Class Name:
Method Name: