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

Before Change


        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)

        tabular.record("Iteration", itr)
        tabular.record("AverageDiscountedReturn", average_discounted_return)
        tabular.record("AverageReturn", average_return)
        tabular.record("Extras/EpisodeRewardMean",
                       np.mean(self._episode_reward_mean))
        tabular.record("NumTrajs", len(paths))
        tabular.record("StdReturn", np.std(undiscounted_returns))
        tabular.record("MaxReturn", np.max(undiscounted_returns))
        tabular.record("MinReturn", np.min(undiscounted_returns))

        return dict(average_return=average_return)

After Change


                                            total_length=self.max_path_length,
                                            axis=0) for path in paths
        ])
        actions = torch.stack([
            loss_function_utils.pad_to_last(path["actions"],
                                            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):
        Log information per iteration based on the collected paths.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

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: tensorflow/cleverhans
Commit Name: 4887ef8baecbf5315ec0f235e56a4f93cd05aad7
Time: 2018-10-04
Author: nottombrown@gmail.com
File Name: cleverhans/attacks_tf.py
Class Name:
Method Name: spm


Project Name: bethgelab/foolbox
Commit Name: 80cfb0e5f889c65a972ebde6c6dae4278b5e28c1
Time: 2020-02-14
Author: git@jonasrauber.de
File Name: foolbox/attacks/base.py
Class Name: MinimizationAttack
Method Name: __call__