diff --git a/keras/backend/theano_backend.py b/keras/backend/theano_backend.py index ecfc5ad48d3..d4a0f282c1a 100644 --- a/keras/backend/theano_backend.py +++ b/keras/backend/theano_backend.py @@ -1536,7 +1536,7 @@ def sparse_categorical_crossentropy(target, output, from_logits=False): target = T.cast(T.flatten(target), 'int32') target = T.extra_ops.to_one_hot(target, nb_class=output.shape[-1]) target = reshape(target, shape(output)) - return categorical_crossentropy(output, target, from_logits) + return categorical_crossentropy(target, output, from_logits) def binary_crossentropy(target, output, from_logits=False):