87232aa39c159f04a501ad268012da45a1ff537c,torch_rl/torch_rl/algos/base.py,BaseAlgo,collect_experiences,#BaseAlgo#,68

Before Change


        log = {
            "return_per_episode": self.log_return.cpu().numpy(),
            "reshaped_return_per_episode": self.log_reshaped_return.cpu().numpy(),
            "num_frames_per_episode": self.log_num_frames.cpu().numpy(),
            "num_frames": self.num_frames
        }

After Change


            self.log_episode_reshaped_return += self.rewards[i]
            self.log_episode_num_frames += torch.ones(self.num_procs, device=self.device)

            for i, done_ in enumerate(done):
                if done_:
                    self.log_done_counter += 1
                    self.log_return.append(self.log_episode_return[i].item())
                    self.log_reshaped_return.append(self.log_episode_reshaped_return[i].item())
                    self.log_num_frames.append(self.log_episode_num_frames[i].item())

            self.log_episode_return *= self.mask
            self.log_episode_reshaped_return *= self.mask
            self.log_episode_num_frames *= self.mask
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: lcswillems/torch-rl
Commit Name: 87232aa39c159f04a501ad268012da45a1ff537c
Time: 2018-05-14
Author: lcswillems@gmail.com
File Name: torch_rl/torch_rl/algos/base.py
Class Name: BaseAlgo
Method Name: collect_experiences


Project Name: allenai/allennlp
Commit Name: 8c89b08a9ee11f62d86a007cee42e5c68afa3d02
Time: 2018-08-20
Author: markn@allenai.org
File Name: allennlp/models/biaffine_dependency_parser.py
Class Name: BiaffineDependencyParser
Method Name: _run_mst_decoding


Project Name: tensorflow/models
Commit Name: bc324fda2866eab986a604b19272137f9006a603
Time: 2021-02-10
Author: arashwan@google.com
File Name: official/vision/beta/tasks/semantic_segmentation.py
Class Name: SemanticSegmentationTask
Method Name: reduce_aggregated_logs


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c17c92d84ec9216b781ecfbc25c6df225e2fd4f1
Time: 2020-11-11
Author: M.N.Tran@ibm.com
File Name: art/defences/preprocessor/audio_filter_pytorch.py
Class Name: AudioFilterPyTorch
Method Name: __call__