7a494dbcc84a5abdf83f3aa9aff2d631f5d5f609,src/garage/tf/algos/ddpg.py,DDPG,train,#DDPG#Any#,270

Before Change


                if (cycle == 0 and self.replay_buffer.n_transitions_stored >=
                        self._min_buffer_size):
                    runner.enable_logging = True
                    log_performance(runner.step_itr,
                                    obtain_evaluation_samples(
                                        self.policy, self._eval_env),
                                    discount=self._discount)
                runner.step_itr += 1

        return last_return

After Change


        
        if not self._eval_env:
            self._eval_env = runner.get_env_copy()
        last_returns = [float("nan")]
        runner.enable_logging = False

        for _ in runner.step_epochs():
            for cycle in range(self._steps_per_epoch):
                runner.step_path = runner.obtain_trajectories(runner.step_itr)
                self.train_once(runner.step_itr, runner.step_path)
                if (cycle == 0 and self.replay_buffer.n_transitions_stored >=
                        self._min_buffer_size):
                    runner.enable_logging = True
                    eval_samples = obtain_evaluation_samples(
                        self.policy, self._eval_env)
                    last_returns = log_performance(runner.step_itr,
                                                   eval_samples,
                                                   discount=self._discount)
                runner.step_itr += 1

        return np.mean(last_returns)

    def train_once(self, itr, trajectories):
        Perform one step of policy optimization given one batch of samples.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 11

Instances


Project Name: rlworkgroup/garage
Commit Name: 7a494dbcc84a5abdf83f3aa9aff2d631f5d5f609
Time: 2020-07-17
Author: 41180126+krzentner@users.noreply.github.com
File Name: src/garage/tf/algos/ddpg.py
Class Name: DDPG
Method Name: train


Project Name: rlworkgroup/garage
Commit Name: 7a494dbcc84a5abdf83f3aa9aff2d631f5d5f609
Time: 2020-07-17
Author: 41180126+krzentner@users.noreply.github.com
File Name: src/garage/tf/algos/dqn.py
Class Name: DQN
Method Name: train


Project Name: rlworkgroup/garage
Commit Name: 7a494dbcc84a5abdf83f3aa9aff2d631f5d5f609
Time: 2020-07-17
Author: 41180126+krzentner@users.noreply.github.com
File Name: src/garage/tf/algos/td3.py
Class Name: TD3
Method Name: train


Project Name: rlworkgroup/garage
Commit Name: 7a494dbcc84a5abdf83f3aa9aff2d631f5d5f609
Time: 2020-07-17
Author: 41180126+krzentner@users.noreply.github.com
File Name: src/garage/torch/algos/ddpg.py
Class Name: DDPG
Method Name: train