3bca459d2fc85937a84a17657e19e7f0167d75ff,ml/rl/training/ddpg_trainer.py,DDPGTrainer,train,#DDPGTrainer#Any#Any#Any#,114

Before Change


            prev_max=self.max_action_range_tensor_serving,
        )
        rewards = Variable(torch.from_numpy(training_samples.rewards).type(self.dtype))
        next_states = Variable(
            torch.from_numpy(training_samples.next_states).type(self.dtype)
        )
        time_diffs = torch.tensor(training_samples.time_diffs).type(self.dtype)
        discount_tensor = torch.tensor(np.full(len(rewards), self.gamma)).type(
            self.dtype
        )

After Change


        actions = Variable(actions)

        if isinstance(training_samples.next_states, torch.Tensor):
            next_states = training_samples.next_states.type(self.dtype)
        else:
            next_states = torch.from_numpy(training_samples.next_states).type(
                self.dtype
            )
        next_states = Variable(next_states)

        // As far as ddpg is concerned all actions are [-1, 1] due to actor tanh
        actions = rescale_torch_tensor(
            actions,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: facebookresearch/Horizon
Commit Name: 3bca459d2fc85937a84a17657e19e7f0167d75ff
Time: 2018-09-14
Author: edoardoc@fb.com
File Name: ml/rl/training/ddpg_trainer.py
Class Name: DDPGTrainer
Method Name: train


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 2365934c716af1c923a185ca0ad0ae1855108eb3
Time: 2020-09-08
Author: M.N.Tran@ibm.com
File Name: art/attacks/evasion/imperceptible_asr/imperceptible_attack_pytorch.py
Class Name: ImperceptibleAttackPytorch
Method Name: _partial_forward


Project Name: facebookresearch/Horizon
Commit Name: 45496de13b7932d8ec860da06f14d113000803be
Time: 2018-08-29
Author: jjg@fb.com
File Name: ml/rl/training/dqn_trainer.py
Class Name: DQNTrainer
Method Name: train