563acaf48cf475f4b125fd32374c6bb566049551,src/garage/torch/algos/vpg.py,VPG,process_samples,#VPG#Any#Any#,268

Before Change


        for path in paths:
            path["returns"] = tensor_utils.discount_cumsum(
                path["rewards"], self.discount)
        average_discounted_return = (np.mean(
            [path["returns"][0] for path in paths]))
        undiscounted_returns = [sum(path["rewards"]) for path in paths]
        average_return = np.mean(undiscounted_returns)

        self._episode_reward_mean.extend(undiscounted_returns)

After Change


                                            total_length=self.max_path_length,
                                            axis=0) for path in paths
        ])
        rewards = torch.stack([
            loss_function_utils.pad_to_last(path["rewards"],
                                            total_length=self.max_path_length)
            for path in paths
        ])

        return valids, obs, actions, rewards

    def _log(self, itr, paths):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: rlworkgroup/garage
Commit Name: 563acaf48cf475f4b125fd32374c6bb566049551
Time: 2019-11-06
Author: 43084978+yonghyuc@users.noreply.github.com
File Name: src/garage/torch/algos/vpg.py
Class Name: VPG
Method Name: process_samples


Project Name: Kaixhin/Rainbow
Commit Name: 22bd62194e97151e6354edd4d04a3c414083cc9c
Time: 2017-11-05
Author: design@kaixhin.com
File Name: model.py
Class Name: DQN
Method Name: forward


Project Name: analysiscenter/batchflow
Commit Name: 260fe0d000a12e869206d8e36300a446a9891b35
Time: 2019-11-17
Author: nikita_007_94@mail.ru
File Name: batchflow/models/eager_torch/layers/core.py
Class Name: Dropout
Method Name: forward


Project Name: Kaixhin/Rainbow
Commit Name: feab638ee8fc9879a61f7c1f056a4ee66be8518a
Time: 2017-11-05
Author: design@kaixhin.com
File Name: model.py
Class Name: DQN
Method Name: forward