From 02ad81aa8b05c86bf02f1dfb883770af6aa51e61 Mon Sep 17 00:00:00 2001 From: nunzip Date: Mon, 4 Mar 2019 17:15:50 +0000 Subject: make test_classifier return the score rather than printing it --- lenet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lenet.py b/lenet.py index a38f4e1..c1c27b5 100644 --- a/lenet.py +++ b/lenet.py @@ -125,8 +125,8 @@ def test_classifier(model, x_test, y_true): y_pred = model.predict(x_test) y_pred = np.argmax(y_pred, axis=1) y_true = np.argmax(y_true, axis=1) - print("Test acc:", accuracy_score(y_true, y_pred)) plot_example_errors(y_pred, y_true, x_test) + return accuracy_score(y_true, y_pred) def mix_data(X_train, y_train, X_validation, y_validation, train_gen, tr_labels_gen, val_gen, val_labels_gen, split=0): -- cgit v1.2.3