From fe7c6df487176370f9d6936560219a623d6e41ea Mon Sep 17 00:00:00 2001 From: Somshubra Majumdar Date: Wed, 15 Feb 2017 01:52:29 -0600 Subject: [PATCH] Corrected the evaluation portion of the script --- examples/cifar10_ror.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/examples/cifar10_ror.py b/examples/cifar10_ror.py index 86d3ee4..ab1e0a6 100644 --- a/examples/cifar10_ror.py +++ b/examples/cifar10_ror.py @@ -50,11 +50,6 @@ model.fit_generator(generator.flow(trainX, trainY, batch_size=batch_size), sampl validation_data=(testX, testY), nb_val_samples=testX.shape[0], verbose=2) -yPreds = model.predict(testX) -yPred = np.argmax(yPreds, axis=1) -yTrue = tempY - -accuracy = metrics.accuracy_score(yTrue, yPred) * 100 -error = 100 - accuracy -print("Accuracy : ", accuracy) -print("Error : ", error) +scores = model.evaluate(testX, testY, batch_size) +print("Test loss : ", scores[0]) +print("Test accuracy : ", scores[1])