From 1cb81f2f9fe20074a3df13716ee3c8eb7bdec109 Mon Sep 17 00:00:00 2001 From: Ehud Ben-Reuven Date: Thu, 3 Aug 2017 12:36:15 -0400 Subject: [PATCH] fix issue #7512 (#7513) --- keras/backend/theano_backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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):