8dcbf002d0058939802920c11f74791708838791,ml/rl/training/ddpg_predictor.py,DDPGPredictor,predict_q_value,#DDPGPredictor#Any#Any#,31

Before Change


            for k, v in actions[i].items():
                action[k - len(state)] = v
            examples.append((state, action))
        output = [self.critic(example[0], example[1]) for example in examples]
        return output

    @classmethod
    def export_actor(cls, trainer):
        return DDPGPredictor(trainer)

After Change


            for k, v in actions[i].items():
                action[k - len(state)] = v
            action_list.append(action)
        output = self.critic(
            Variable(torch.from_numpy(np.array(state_list))),
            Variable(torch.from_numpy(np.array(action_list)))
        )
        return output.data.numpy()

    @classmethod
    def export_actor(cls, trainer):
        return DDPGPredictor(trainer)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: facebookresearch/Horizon
Commit Name: 8dcbf002d0058939802920c11f74791708838791
Time: 2018-04-06
Author: edoardoc@fb.com
File Name: ml/rl/training/ddpg_predictor.py
Class Name: DDPGPredictor
Method Name: predict_q_value


Project Name: kengz/SLM-Lab
Commit Name: 4df11055e61fa6c9fede6b2114c8ce05de9a035e
Time: 2017-12-08
Author: lgraesser@users.noreply.github.com
File Name: slm_lab/agent/algorithm/dqn.py
Class Name: DQNBase
Method Name: train


Project Name: facebookresearch/Horizon
Commit Name: 8dcbf002d0058939802920c11f74791708838791
Time: 2018-04-06
Author: edoardoc@fb.com
File Name: ml/rl/training/ddpg_predictor.py
Class Name: DDPGPredictor
Method Name: predict_action