98f57a0d8781083cbca137fb9d84313b94d9d108,agents/ddpg_agent.py,DDPGAgent,choose_action,#DDPGAgent#Any#Any#,84

Before Change


    def choose_action(self, curr_state, phase=RunPhase.TRAIN):
        assert not self.env.discrete_controls, "DDPG works only for continuous control problems"
        // convert to batch so we can run it through the network
        observation = np.expand_dims(np.array(curr_state["observation"]), 0)
        result = self.actor_network.online_network.predict(observation)
        action_values = result[0].squeeze()

        if phase == RunPhase.TRAIN:

After Change


        if type(action) != np.ndarray:
            action_batch = np.array([[action]])
        inputs = self.tf_input_state(curr_state)
        inputs["action"] = action_batch
        q_value = self.critic_network.online_network.predict(inputs)[0]
        self.q_values.add_sample(q_value)
        action_info = {"action_value": q_value}
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: NervanaSystems/coach
Commit Name: 98f57a0d8781083cbca137fb9d84313b94d9d108
Time: 2018-02-21
Author: zach.dwiel@intel.com
File Name: agents/ddpg_agent.py
Class Name: DDPGAgent
Method Name: choose_action


Project Name: NervanaSystems/coach
Commit Name: 39a28aba95b0d8eeb56f7a17b7dad140e601b591
Time: 2018-02-21
Author: zach.dwiel@intel.com
File Name: agents/value_optimization_agent.py
Class Name: ValueOptimizationAgent
Method Name: tf_input_state


Project Name: uber/ludwig
Commit Name: 859295134f42479477f893c429695742c14dfe97
Time: 2020-05-06
Author: piero@uber.com
File Name: ludwig/neuropod.py
Class Name:
Method Name: postprocess_for_neuropod