From 6195f5d6fb949c528386e514a9c68e73d70a1f1c Mon Sep 17 00:00:00 2001 From: Noah Wiggin <77313083+wigginno@users.noreply.github.com> Date: Sat, 27 Jan 2024 12:29:16 -0500 Subject: [PATCH] Fix training notebook bug related to larger batch size --- .../train_binary_segmentation.ipynb | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/notebooks/microvessels_segmentation_training/train_binary_segmentation.ipynb b/notebooks/microvessels_segmentation_training/train_binary_segmentation.ipynb index fe680a7..b6394ed 100644 --- a/notebooks/microvessels_segmentation_training/train_binary_segmentation.ipynb +++ b/notebooks/microvessels_segmentation_training/train_binary_segmentation.ipynb @@ -3,8 +3,8 @@ { "cell_type": "markdown", "metadata": { - "colab_type": "text", - "id": "view-in-github" + "id": "view-in-github", + "colab_type": "text" }, "source": [ "\"Open" @@ -39,7 +39,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -487,7 +487,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -554,7 +554,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "id": "ZsraYg1EH0iN" }, @@ -586,7 +586,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": { "id": "3hZ4rclKIItR" }, @@ -608,7 +608,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": { "id": "KBnYCIlVZDo3" }, @@ -636,7 +636,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": { "id": "LHtbr58qGY_u" }, @@ -667,7 +667,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -722,7 +722,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": { "id": "Fo6FQg9XMeUJ" }, @@ -757,7 +757,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -790,7 +790,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -831,7 +831,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": { "id": "fAZ_UNB2JbRr" }, @@ -857,7 +857,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": { "id": "qqr7yKMlMWfg" }, @@ -904,7 +904,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": { "id": "4XL-75mJMWmG" }, @@ -935,7 +935,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -1046,7 +1046,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -1139,7 +1139,7 @@ ], "source": [ "X, y, _ = val_gen[1]\n", - "for i in range(batch_size):\n", + "for i in range(min(batch_size, len(X))):\n", " fig, ax = plt.subplots(1, 2, figsize=(10, 5))\n", " ax[0].imshow(X[i][:,:,0], cmap='gray')\n", " ax[1].imshow(y[i][:,:,0], cmap='gray')\n", @@ -1180,7 +1180,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -1496,8 +1496,8 @@ "accelerator": "GPU", "colab": { "gpuClass": "premium", - "include_colab_link": true, - "provenance": [] + "provenance": [], + "include_colab_link": true }, "gpuClass": "premium", "kernelspec": { @@ -1519,4 +1519,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} +} \ No newline at end of file