4e008e79147043207a5d0032aa771d7f811af0e1,chainerrl/agents/dqn.py,DQN,_compute_target_values,#DQN#Any#Any#,251
Before Change
def _compute_target_values(self, experiences, gamma):
batch_next_state = self._batch_states(
[elem["next_state"] for elem in experiences])
target_next_qout = self.target_model(batch_next_state, test=True)
next_q_max = target_next_qout.max
next_q_max.creator = None
batch_rewards = self.xp.asarray(
[elem["reward"] for elem in experiences], dtype=np.float32)
batch_terminal = self.xp.asarray(
[elem["is_state_terminal"] for elem in experiences],
dtype=np.float32)
return batch_rewards + self.gamma * (1.0 - batch_terminal) * next_q_max
def _compute_y_and_t(self, experiences, gamma):
After Change
def _compute_target_values(self, exp_batch, gamma):
batch_next_state = exp_batch["next_state"]
target_next_qout = self.target_model(batch_next_state, test=True)
next_q_max = target_next_qout.max
next_q_max.creator = None
batch_rewards = exp_batch["reward"]
batch_terminal = exp_batch["is_state_terminal"]
return batch_rewards + self.gamma * (1.0 - batch_terminal) * next_q_max
def _compute_y_and_t(self, exp_batch, gamma):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 28
Instances
Project Name: chainer/chainerrl
Commit Name: 4e008e79147043207a5d0032aa771d7f811af0e1
Time: 2017-01-05
Author: muupan@gmail.com
File Name: chainerrl/agents/dqn.py
Class Name: DQN
Method Name: _compute_target_values
Project Name: chainer/chainerrl
Commit Name: 88fd013c122905fbda18d9676074bc73e3e15030
Time: 2017-01-16
Author: muupan@gmail.com
File Name: chainerrl/agents/residual_dqn.py
Class Name: ResidualDQN
Method Name: _compute_target_values
Project Name: chainer/chainerrl
Commit Name: 4e008e79147043207a5d0032aa771d7f811af0e1
Time: 2017-01-05
Author: muupan@gmail.com
File Name: chainerrl/agents/dqn.py
Class Name: DQN
Method Name: _compute_target_values
Project Name: chainer/chainerrl
Commit Name: 7cebf32b75ef71ea8e367579c71fea84deaac91b
Time: 2017-01-15
Author: muupan@gmail.com
File Name: chainerrl/agents/dpp.py
Class Name: AbstractDPP
Method Name: _compute_target_values