Skip to content

Commit

Permalink
Created using Colab
Browse files Browse the repository at this point in the history
  • Loading branch information
neworderofjamie committed Dec 2, 2024
1 parent c1b1faa commit bdf3fbc
Showing 1 changed file with 64 additions and 86 deletions.
150 changes: 64 additions & 86 deletions docs/tutorials/mnist_inference/tutorial_2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,31 @@
"cell_type": "code",
"source": [
"if \"google.colab\" in str(get_ipython()):\n",
" #import IPython\n",
" #IPython.core.magics.execution.ExecutionMagics.run.func_defaults[2] = lambda a: a\n",
" #%run \"../install_collab.ipynb\"\n",
" !pip install gdown --upgrade\n",
" !gdown 1V_GzXUDzcFz9QDIpxAD8QNEglcSipssW\n",
" !pip install pygenn-5.0.0-cp310-cp310-linux_x86_64.whl\n",
" !gdown 1OJH0FAR4GRsvIKkHw0NBM-9aYU2VJ1bo\n",
" !pip install pygenn-5.1.0-cp310-cp310-linux_x86_64.whl\n",
" %env CUDA_PATH=/usr/local/cuda"
],
"metadata": {
"id": "Qqz__TiIdE9x",
"outputId": "912641fe-072b-48d1-aa90-f911ab463cd3",
"outputId": "e736020d-0e79-408c-ba33-518f143b5b8c",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"execution_count": null,
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Requirement already satisfied: gdown in /usr/local/lib/python3.10/dist-packages (5.1.0)\n",
"Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.10/dist-packages (from gdown) (4.12.3)\n",
"Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from gdown) (3.13.1)\n",
"Requirement already satisfied: requests[socks] in /usr/local/lib/python3.10/dist-packages (from gdown) (2.31.0)\n",
"Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from gdown) (4.66.2)\n",
"Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.10/dist-packages (from beautifulsoup4->gdown) (2.5)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests[socks]->gdown) (3.3.2)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests[socks]->gdown) (3.6)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests[socks]->gdown) (2.0.7)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests[socks]->gdown) (2024.2.2)\n",
"Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in /usr/local/lib/python3.10/dist-packages (from requests[socks]->gdown) (1.7.1)\n",
"Downloading...\n",
"From: https://drive.google.com/uc?id=1V_GzXUDzcFz9QDIpxAD8QNEglcSipssW\n",
"To: /content/pygenn-5.0.0-cp310-cp310-linux_x86_64.whl\n",
"100% 8.29M/8.29M [00:00<00:00, 149MB/s]\n",
"Processing ./pygenn-5.0.0-cp310-cp310-linux_x86_64.whl\n",
"Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from pygenn==5.0.0) (1.25.2)\n",
"Requirement already satisfied: deprecated in /usr/local/lib/python3.10/dist-packages (from pygenn==5.0.0) (1.2.14)\n",
"Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from pygenn==5.0.0) (5.9.5)\n",
"Requirement already satisfied: wrapt<2,>=1.10 in /usr/local/lib/python3.10/dist-packages (from deprecated->pygenn==5.0.0) (1.14.1)\n",
"From: https://drive.google.com/uc?id=1OJH0FAR4GRsvIKkHw0NBM-9aYU2VJ1bo\n",
"To: /content/pygenn-5.1.0-cp310-cp310-linux_x86_64.whl\n",
"\r 0% 0.00/8.47M [00:00<?, ?B/s]\r100% 8.47M/8.47M [00:00<00:00, 200MB/s]\n",
"Processing ./pygenn-5.1.0-cp310-cp310-linux_x86_64.whl\n",
"Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from pygenn==5.1.0) (1.26.4)\n",
"Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from pygenn==5.1.0) (5.9.5)\n",
"Requirement already satisfied: setuptools in /usr/local/lib/python3.10/dist-packages (from pygenn==5.1.0) (75.1.0)\n",
"pygenn is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.\n",
"env: CUDA_PATH=/usr/local/cuda\n"
]
Expand All @@ -75,13 +59,13 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "N-2PV7LcdFg_",
"outputId": "1404acd1-ba2c-4c08-c620-c1ad71ece658"
"outputId": "4f3891b6-c9d3-4255-a474-ca5fdf5038f3"
},
"outputs": [
{
Expand All @@ -91,11 +75,11 @@
"Downloading...\n",
"From: https://drive.google.com/uc?id=1cmNL8W0QZZtn3dPHiOQnVjGAYTk6Rhpc\n",
"To: /content/weights_0_1.npy\n",
"100% 402k/402k [00:00<00:00, 127MB/s]\n",
"100% 402k/402k [00:00<00:00, 47.7MB/s]\n",
"Downloading...\n",
"From: https://drive.google.com/uc?id=131lCXLEH6aTXnBZ9Nh4eJLSy5DQ6LKSF\n",
"To: /content/weights_1_2.npy\n",
"100% 5.25k/5.25k [00:00<00:00, 23.6MB/s]\n"
"100% 5.25k/5.25k [00:00<00:00, 19.1MB/s]\n"
]
}
],
Expand All @@ -120,20 +104,21 @@
],
"metadata": {
"id": "AikBc4sfg1b-",
"outputId": "ddb641da-6ec7-459f-db01-5157d2a17f49",
"outputId": "3de6d9ba-2def-4e50-e056-a7439efc9b88",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"execution_count": null,
"execution_count": 3,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Collecting mnist\n",
" Downloading mnist-0.2.2-py2.py3-none-any.whl (3.5 kB)\n",
"Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from mnist) (1.25.2)\n",
" Downloading mnist-0.2.2-py2.py3-none-any.whl.metadata (1.6 kB)\n",
"Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from mnist) (1.26.4)\n",
"Downloading mnist-0.2.2-py2.py3-none-any.whl (3.5 kB)\n",
"Installing collected packages: mnist\n",
"Successfully installed mnist-0.2.2\n"
]
Expand All @@ -152,7 +137,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {
"id": "agqWFZjickfU"
},
Expand All @@ -178,7 +163,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {
"id": "KqBx7iO_kApE"
},
Expand All @@ -200,7 +185,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {
"id": "-7lzXzmQcgbt"
},
Expand Down Expand Up @@ -235,7 +220,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {
"id": "Sx1VOU5udixG"
},
Expand Down Expand Up @@ -282,7 +267,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {
"id": "K8kHbKMJ3kIY"
},
Expand All @@ -292,13 +277,6 @@
"model.load()"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "oMxrFcIP66CX"
},
"source": []
},
{
"cell_type": "markdown",
"metadata": {
Expand All @@ -310,7 +288,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {
"id": "0Tf07KUOeP-X"
},
Expand All @@ -337,7 +315,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {
"id": "3z1ccKHeejeB"
},
Expand Down Expand Up @@ -367,27 +345,27 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 101,
"referenced_widgets": [
"e2a5b2d7a928414c921ef1945e969ff2",
"3822016801b34d7c91f7973ce35b7918",
"07ddfc013d83495fa87c3fc1df6a8870",
"2659dd42699542deac2a7dadbe9eca61",
"9f19ea2e563f40409e23389b5dc4a0a8",
"0e560bce941d4b28847ce2e58bf19bff",
"8c69c9171dae42d2a8fc3867c092ece1",
"3d4d8e0017d648bfabd8fcf0c89f4ec8",
"2e72f36403e6469c8670f67a3dffb5ef",
"098d0a4e89024f8fa8c61ff3f5c477d5",
"bb812d858cf746be9e33b71e67fc04f6"
"bf1d3b07065b472a94fb3aec0f72fe43",
"4b527efeea5c468d948ea096cab5184b",
"e0deaabe628b4a25b2a1cf25c268ad7e",
"399a44ea230d4660b9c1c96bfc7d7b75",
"b9a78185deba437facec9281ab2ba896",
"f0232261485d4aff9dccfc62da3bd22a",
"33c14161ae2c4cf08d021e2b951ac908",
"a90f9753b20b49e293e411bcf8cb19fc",
"8f45d4358ffd4b0cad8f7a25c922bf35",
"f3aecbe8c5e14160850cbfce713588bc",
"313f61f34af64c22b5d108bdbc17e80b"
]
},
"id": "4qSoinT4etKq",
"outputId": "01a98bc1-3bb6-4fab-b172-598e3f90fb2b"
"outputId": "2bcc0eda-0bbf-4570-8cd8-f5dcdaa239e1"
},
"outputs": [
{
Expand All @@ -399,7 +377,7 @@
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "e2a5b2d7a928414c921ef1945e969ff2"
"model_id": "bf1d3b07065b472a94fb3aec0f72fe43"
}
},
"metadata": {}
Expand All @@ -410,7 +388,7 @@
"text": [
"\n",
"Accuracy 97.44%%\n",
"Time 11.930175114999997 seconds\n"
"Time 11.59845029600001 seconds\n"
]
}
],
Expand Down Expand Up @@ -478,7 +456,7 @@
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"e2a5b2d7a928414c921ef1945e969ff2": {
"bf1d3b07065b472a94fb3aec0f72fe43": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
Expand All @@ -493,14 +471,14 @@
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_3822016801b34d7c91f7973ce35b7918",
"IPY_MODEL_07ddfc013d83495fa87c3fc1df6a8870",
"IPY_MODEL_2659dd42699542deac2a7dadbe9eca61"
"IPY_MODEL_4b527efeea5c468d948ea096cab5184b",
"IPY_MODEL_e0deaabe628b4a25b2a1cf25c268ad7e",
"IPY_MODEL_399a44ea230d4660b9c1c96bfc7d7b75"
],
"layout": "IPY_MODEL_9f19ea2e563f40409e23389b5dc4a0a8"
"layout": "IPY_MODEL_b9a78185deba437facec9281ab2ba896"
}
},
"3822016801b34d7c91f7973ce35b7918": {
"4b527efeea5c468d948ea096cab5184b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
Expand All @@ -515,13 +493,13 @@
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_0e560bce941d4b28847ce2e58bf19bff",
"layout": "IPY_MODEL_f0232261485d4aff9dccfc62da3bd22a",
"placeholder": "",
"style": "IPY_MODEL_8c69c9171dae42d2a8fc3867c092ece1",
"style": "IPY_MODEL_33c14161ae2c4cf08d021e2b951ac908",
"value": "100%"
}
},
"07ddfc013d83495fa87c3fc1df6a8870": {
"e0deaabe628b4a25b2a1cf25c268ad7e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
Expand All @@ -537,15 +515,15 @@
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_3d4d8e0017d648bfabd8fcf0c89f4ec8",
"layout": "IPY_MODEL_a90f9753b20b49e293e411bcf8cb19fc",
"max": 10000,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_2e72f36403e6469c8670f67a3dffb5ef",
"style": "IPY_MODEL_8f45d4358ffd4b0cad8f7a25c922bf35",
"value": 10000
}
},
"2659dd42699542deac2a7dadbe9eca61": {
"399a44ea230d4660b9c1c96bfc7d7b75": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
Expand All @@ -560,13 +538,13 @@
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_098d0a4e89024f8fa8c61ff3f5c477d5",
"layout": "IPY_MODEL_f3aecbe8c5e14160850cbfce713588bc",
"placeholder": "",
"style": "IPY_MODEL_bb812d858cf746be9e33b71e67fc04f6",
"value": " 10000/10000 [00:11&lt;00:00, 901.53it/s]"
"style": "IPY_MODEL_313f61f34af64c22b5d108bdbc17e80b",
"value": " 10000/10000 [00:11&lt;00:00, 960.95it/s]"
}
},
"9f19ea2e563f40409e23389b5dc4a0a8": {
"b9a78185deba437facec9281ab2ba896": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
Expand Down Expand Up @@ -618,7 +596,7 @@
"width": null
}
},
"0e560bce941d4b28847ce2e58bf19bff": {
"f0232261485d4aff9dccfc62da3bd22a": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
Expand Down Expand Up @@ -670,7 +648,7 @@
"width": null
}
},
"8c69c9171dae42d2a8fc3867c092ece1": {
"33c14161ae2c4cf08d021e2b951ac908": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
Expand All @@ -685,7 +663,7 @@
"description_width": ""
}
},
"3d4d8e0017d648bfabd8fcf0c89f4ec8": {
"a90f9753b20b49e293e411bcf8cb19fc": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
Expand Down Expand Up @@ -737,7 +715,7 @@
"width": null
}
},
"2e72f36403e6469c8670f67a3dffb5ef": {
"8f45d4358ffd4b0cad8f7a25c922bf35": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
Expand All @@ -753,7 +731,7 @@
"description_width": ""
}
},
"098d0a4e89024f8fa8c61ff3f5c477d5": {
"f3aecbe8c5e14160850cbfce713588bc": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
Expand Down Expand Up @@ -805,7 +783,7 @@
"width": null
}
},
"bb812d858cf746be9e33b71e67fc04f6": {
"313f61f34af64c22b5d108bdbc17e80b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
Expand Down

0 comments on commit bdf3fbc

Please sign in to comment.