From 07ee788cd593f30c5ca5adec4b8db5a10d8ac298 Mon Sep 17 00:00:00 2001 From: Vadim Pushtaev Date: Sun, 9 Apr 2023 23:23:04 +0300 Subject: [PATCH] division operator fix: add_subplot requires int --- .../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 412f3bf47a..7521ea8406 100644 --- a/convolutional-neural-networks/mnist-mlp/mnist_mlp_exercise.ipynb +++ b/convolutional-neural-networks/mnist-mlp/mnist_mlp_exercise.ipynb @@ -372,7 +372,7 @@ "# plot the images in the batch, along with predicted and true labels\n", "fig = plt.figure(figsize=(25, 4))\n", "for idx in np.arange(20):\n", - " ax = fig.add_subplot(2, 20/2, idx+1, xticks=[], yticks=[])\n", + " ax = fig.add_subplot(2, 20//2, idx+1, xticks=[], yticks=[])\n", " ax.imshow(np.squeeze(images[idx]), cmap='gray')\n", " ax.set_title(\"{} ({})\".format(str(preds[idx].item()), str(labels[idx].item())),\n", " color=(\"green\" if preds[idx]==labels[idx] else \"red\"))"