Skip to content
Permalink
Browse files

fine tune sparse_categorical_crossentropy (#13010)

  • Loading branch information...
bojone authored and fchollet committed Jun 27, 2019
1 parent b810de6 commit 613aeff37a721450d94906df1a3f3cc51e2299d4
Showing with 1 addition and 1 deletion.
  1. +1 −1 keras/backend/tensorflow_backend.py
@@ -3611,7 +3611,7 @@ def sparse_categorical_crossentropy(target, output, from_logits=False, axis=-1):

output_shape = output.get_shape()
targets = cast(flatten(target), 'int64')
logits = tf.reshape(output, [-1, int(output_shape[-1])])
logits = tf.reshape(output, [-1, tf.shape(output)[-1]])
res = tf.nn.sparse_softmax_cross_entropy_with_logits(
labels=targets,
logits=logits)

0 comments on commit 613aeff

Please sign in to comment.
You can’t perform that action at this time.