def update_weights(self):
    if (len(self.buffer) < self.batch_size):
        return
    (states, actions, rewards, next_states, done_list) = self.buffer.sample(self.batch_size, dqn=True)
    targets = (rewards + ((self.gamma * np.max(self.model_target.predict_on_batch([np.concatenate(next_states[0]).reshape((- 1), *self.combined_observation_space[0]), np.concatenate(next_states[1]).reshape((- 1), self.combined_observation_space[1])]), axis=1)) * (1 - done_list)))
    target_vec = self.model.predict_on_batch([np.concatenate(states[0]).reshape((- 1), *self.combined_observation_space[0]), np.concatenate(states[1]).reshape((- 1), self.combined_observation_space[1])])
    indexes = np.array([i for i in range(self.batch_size)])
    target_vec[([indexes], [actions])] = targets
    self.model.fit([np.concatenate(states[0]).reshape((- 1), *self.combined_observation_space[0]), np.concatenate(states[1]).reshape((- 1), self.combined_observation_space[1])], target_vec, epochs=1, verbose=0)
def update_weights(self):
    if (len(self.buffer) < self.batch_size):
        return
    (states, actions, rewards, next_states, done_list) = self.buffer.sample(self.batch_size, dqn=True)
    targets = (rewards + ((self.gamma * np.max(self.model_target.predict_on_batch([np.concatenate(next_states[0]).reshape((- 1), *self.combined_observation_space[0]), np.concatenate(next_states[1]).reshape((- 1), self.combined_observation_space[1])]), axis=1)) * (1 - done_list)))
    target_vec = self.model.predict_on_batch([np.concatenate(states[0]).reshape((- 1), *self.combined_observation_space[0]), np.concatenate(states[1]).reshape((- 1), self.combined_observation_space[1])])
    indexes = np.array([i for i in range(self.batch_size)])
    target_vec[([indexes], [actions])] = targets
    self.model.fit([np.concatenate(states[0]).reshape((- 1), *self.combined_observation_space[0]), np.concatenate(states[1]).reshape((- 1), self.combined_observation_space[1])], target_vec, epochs=1, verbose=0)