Skip to content

Commit

Permalink
Remove double negative.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkDaoust authored Aug 30, 2018
1 parent 7cb88e1 commit 949b198
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions research/a3c_blogpost/a3c_cartpole.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ def compute_loss(self,

# Calculate our policy loss
policy = tf.nn.softmax(logits)
entropy = -tf.nn.softmax_cross_entropy_with_logits_v2(labels=policy, logits=logits)
entropy = tf.nn.softmax_cross_entropy_with_logits_v2(labels=policy, logits=logits)

policy_loss = tf.nn.sparse_softmax_cross_entropy_with_logits(labels=memory.actions,
logits=logits)
policy_loss *= tf.stop_gradient(advantage)
policy_loss -= 0.01 * entropy
policy_loss = 0.01 * entropy
total_loss = tf.reduce_mean((0.5 * value_loss + policy_loss))
return total_loss

Expand Down

0 comments on commit 949b198

Please sign in to comment.