From a9d22671c3f71476ec6585ed37820d6e937baa3e Mon Sep 17 00:00:00 2001 From: Alireza Saberi Date: Sun, 19 Jan 2020 10:58:16 -0800 Subject: [PATCH] Remove Redundant np.sum() on a single cell class_correct[i] is a single cell and there is no need to be wrapped in np.sum(). I tested the output with the change to make sure it works. --- .../mnist-mlp/mnist_mlp_exercise.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convolutional-neural-networks/mnist-mlp/mnist_mlp_exercise.ipynb b/convolutional-neural-networks/mnist-mlp/mnist_mlp_exercise.ipynb index 062dcb97b1..de9c6c7cb9 100644 --- a/convolutional-neural-networks/mnist-mlp/mnist_mlp_exercise.ipynb +++ b/convolutional-neural-networks/mnist-mlp/mnist_mlp_exercise.ipynb @@ -322,7 +322,7 @@ " if class_total[i] > 0:\n", " print('Test Accuracy of %5s: %2d%% (%2d/%2d)' % (\n", " str(i), 100 * class_correct[i] / class_total[i],\n", - " np.sum(class_correct[i]), np.sum(class_total[i])))\n", + " class_correct[i], class_total[i]))\n", " else:\n", " print('Test Accuracy of %5s: N/A (no training examples)' % (classes[i]))\n", "\n",