Skip to content

Commit e837c61

Browse files
committed
[cost] cross entropy for TF 1.0
1 parent 09970c7 commit e837c61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensorlayer/cost.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def cross_entropy(output, target, name="cross_entropy_loss"):
3030
- The code is borrowed from: `here <https://en.wikipedia.org/wiki/Cross_entropy>`_.
3131
"""
3232
if tf.__version__ <= "0.12":
33-
return tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits=output, labels=target, name=name))
33+
return tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits=output, targets=target, name=name))
3434
else: # TF 1.0
3535
return tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(labels=target, logits=outputs, name=name))
3636

0 commit comments

Comments
 (0)