Why I have very different loss values in training using these two lines code to define the loss function?

modellstm.compile(loss=K.categorical_crossentropy, optimizer=OPTIMIZER,metrics=["accuracy"])
Output : 
59s - loss: 12.8045 - acc: 0.2530 - val_loss: 12.7778 - val_acc: 0.2289

and with :

modellstm.compile(loss='categorical_crossentropy', optimizer=OPTIMIZER,metrics=["accuracy"])
59s - loss: 1.6156 - acc: 0.2042 - val_loss: 1.6016 - val_acc: 0.2241

everything else is the same .... using loss=K.categorical_crossentropy the values (loss) are so high!

What I am missing?

Thanks in advance


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.