65af003602d38cd1f324e0bcfce40c7f0987eec0,main.py,,main,#,41

Before Change


    rollouts.obs[0].copy_(obs)

    // These variables are used to compute average rewards for all processes.
    episode_rewards = torch.zeros([args.num_processes, 1])
    final_rewards = torch.zeros([args.num_processes, 1])

    rollouts.to(device)

    start = time.time()
    for j in range(num_updates):
        for step in range(args.num_steps):
            // Sample actions
            with torch.no_grad():
                value, action, action_log_prob, recurrent_hidden_states = actor_critic.act(
                        rollouts.obs[step],
                        rollouts.recurrent_hidden_states[step],
                        rollouts.masks[step])

            // Obser reward and next obs
            obs, reward, done, info = envs.step(action)
            episode_rewards += reward

            // If done then clean the history of observations.
            masks = torch.FloatTensor([[0.0] if done_ else [1.0] for done_ in done])
            final_rewards *= masks
            final_rewards += (1 - masks) * episode_rewards
            episode_rewards *= masks

            rollouts.insert(obs, recurrent_hidden_states, action, action_log_prob, value, reward, masks)

After Change


    rollouts.obs[0].copy_(obs)
    rollouts.to(device)

    episode_rewards = deque(maxlen=10)
    
    start = time.time()
    for j in range(num_updates):
        for step in range(args.num_steps):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 4

Instances


Project Name: ikostrikov/pytorch-a2c-ppo-acktr
Commit Name: 65af003602d38cd1f324e0bcfce40c7f0987eec0
Time: 2018-09-05
Author: ikostrikov@gmail.com
File Name: main.py
Class Name:
Method Name: main


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: a4c7526f0dac2df5ccff9e51c380cbbe48711d39
Time: 2015-11-03
Author: connormccoy@google.com
File Name: perfkitbenchmarker/static_virtual_machine.py
Class Name: StaticVirtualMachine
Method Name: StaticVirtualMachine_1


Project Name: Microsoft/nni
Commit Name: 171400ee5dfff3f7cc1775ad080a80786688b3d7
Time: 2020-09-18
Author: im.cqyan@gmail.com
File Name: src/sdk/pynni/nni/evolution_tuner/evolution_tuner.py
Class Name: EvolutionTuner
Method Name: __init__


Project Name: rtqichen/torchdiffeq
Commit Name: b914816142ae2776f531be1c0b49812a0bfde91f
Time: 2020-08-04
Author: 33688385+patrick-kidger@users.noreply.github.com
File Name: torchdiffeq/_impl/adams.py
Class Name:
Method Name: g_and_explicit_phi


Project Name: cornellius-gp/gpytorch
Commit Name: 303217b34070dc47a86622b62764098999b0d7f5
Time: 2018-12-12
Author: gpleiss@gmail.com
File Name: gpytorch/lazy/lazy_tensor.py
Class Name: LazyTensor
Method Name: _quad_form_derivative