def prepare_loss(self, entropy_beta):
    with tf.device("/cpu:0"):
      # taken action (input for policy)
      self.a = tf.placeholder("float", [1, self._action_size])
    
      # temporary difference (R-V) (input for policy)
      self.td = tf.placeholder("float", [1])
      # policy entropy
      entropy = -tf.reduce_sum(self.pi * tf.log(self.pi))
      # policy loss (output)  (add minus, because this is for gradient ascent)
      self.policy_loss = -( tf.reduce_sum( tf.mul( tf.log(self.pi), self.a ) ) * self.td + entropy * entropy_beta )

      # R (input for value)
      self.r = tf.placeholder("float", [1])
      # value loss (output)
      self.value_loss = tf.reduce_mean(tf.square(self.v - self.r))
dataset/ETHPy150Open miyosuda/async_deep_reinforce/game_ac_network.py/GameACNetwork.prepare_loss/swapped operands of `-`