history = model.fit(X_train, y_train, batch_size=batch_size, nb_epoch=
    nb_epochs, validation_data=(X_test, y_test), show_accuracy=True)
print(('Test score', history.history['val_loss'][nb_epochs - 1]))
How to get both score and accuracy after training