Skip to content

Commit

Permalink
tutorial ipynb update
Browse files Browse the repository at this point in the history
  • Loading branch information
jeshraghian committed Oct 14, 2023
1 parent d74ec41 commit cd875a2
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 28 deletions.
4 changes: 2 additions & 2 deletions examples/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"For a comprehensive overview on how SNNs work, and what is going on under the hood, [then you might be interested in the snnTorch tutorial series available here.](https://snntorch.readthedocs.io/en/latest/tutorials/index.html)\n",
"The snnTorch tutorial series is based on the following paper. If you find these resources or code useful in your work, please consider citing the following source:\n",
"\n",
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". arXiv preprint arXiv:2109.12894, September 2021.](https://arxiv.org/abs/2109.12894) </cite>"
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". Proceedings of the IEEE, 111(9) September 2023.](https://ieeexplore.ieee.org/abstract/document/10242251) </cite>"
]
},
{
Expand Down Expand Up @@ -88,7 +88,7 @@
"outputs": [],
"source": [
"batch_size = 128\n",
"data_path='/data/mnist'\n",
"data_path='/tmp/data/mnist'\n",
"device = torch.device(\"cuda\") if torch.cuda.is_available() else torch.device(\"cpu\")"
]
},
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial_5_FCN.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"source": [
"The snnTorch tutorial series is based on the following paper. If you find these resources or code useful in your work, please consider citing the following source:\n",
"\n",
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". arXiv preprint arXiv:2109.12894, September 2021.](https://arxiv.org/abs/2109.12894) </cite>\n",
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". Proceedings of the IEEE, 111(9) September 2023.](https://ieeexplore.ieee.org/abstract/document/10242251) </cite>\n",
"\n"
]
},
Expand Down
24 changes: 12 additions & 12 deletions examples/tutorial_6_CNN.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/jeshraghian/snntorch/blob/docs-update/examples/tutorial_6_CNN.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
Expand Down Expand Up @@ -41,7 +41,7 @@
"source": [
"The snnTorch tutorial series is based on the following paper. If you find these resources or code useful in your work, please consider citing the following source:\n",
"\n",
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". arXiv preprint arXiv:2109.12894, September 2021.](https://arxiv.org/abs/2109.12894) </cite>\n"
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". Proceedings of the IEEE, 111(9) September 2023.](https://ieeexplore.ieee.org/abstract/document/10242251) </cite>\n"
]
},
{
Expand Down Expand Up @@ -261,7 +261,7 @@
"source": [
"# dataloader arguments\n",
"batch_size = 128\n",
"data_path='/data/mnist'\n",
"data_path='/tmp/data/mnist'\n",
"\n",
"dtype = torch.float\n",
"device = torch.device(\"cuda\") if torch.cuda.is_available() else torch.device(\"cpu\")"
Expand Down Expand Up @@ -630,6 +630,11 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "y_VQ9es-gSO3"
},
"outputs": [],
"source": [
"optimizer = torch.optim.Adam(net.parameters(), lr=1e-2, betas=(0.9, 0.999))\n",
"num_epochs = 1\n",
Expand Down Expand Up @@ -671,12 +676,7 @@
" test_acc_hist.append(test_acc.item())\n",
"\n",
" counter += 1"
],
"metadata": {
"id": "y_VQ9es-gSO3"
},
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -816,9 +816,9 @@
"metadata": {
"accelerator": "GPU",
"colab": {
"include_colab_link": true,
"name": "tutorial_6_CNN.ipynb",
"provenance": [],
"include_colab_link": true
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
Expand Down
18 changes: 9 additions & 9 deletions examples/tutorial_7_neuromorphic_datasets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/jeshraghian/snntorch/blob/docs-update/examples/tutorial_7_neuromorphic_datasets.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
Expand Down Expand Up @@ -41,7 +41,7 @@
"source": [
"The snnTorch tutorial series is based on the following paper. If you find these resources or code useful in your work, please consider citing the following source:\n",
"\n",
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". arXiv preprint arXiv:2109.12894, September 2021.](https://arxiv.org/abs/2109.12894) </cite>"
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". Proceedings of the IEEE, 111(9) September 2023.](https://ieeexplore.ieee.org/abstract/document/10242251) </cite>"
]
},
{
Expand Down Expand Up @@ -170,8 +170,8 @@
" time_window=1000)\n",
" ])\n",
"\n",
"trainset = tonic.datasets.NMNIST(save_to='./data', transform=frame_transform, train=True)\n",
"testset = tonic.datasets.NMNIST(save_to='./data', transform=frame_transform, train=False)"
"trainset = tonic.datasets.NMNIST(save_to='./tmp/data', transform=frame_transform, train=True)\n",
"testset = tonic.datasets.NMNIST(save_to='./tmp/data', transform=frame_transform, train=False)"
]
},
{
Expand Down Expand Up @@ -641,10 +641,11 @@
"metadata": {
"accelerator": "GPU",
"colab": {
"include_colab_link": true,
"name": "Copy of tutorial_5_neuromorphic_datasets.ipynb",
"provenance": [],
"include_colab_link": true
"provenance": []
},
"gpuClass": "standard",
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
Expand All @@ -661,8 +662,7 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
},
"gpuClass": "standard"
}
},
"nbformat": 4,
"nbformat_minor": 5
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial_regression_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"\n",
"> <cite> [Alexander Henkes, Jason K. Eshraghian, and Henning Wessels. “Spiking neural networks for nonlinear regression\", arXiv preprint arXiv:2210.03515, October 2022.](https://arxiv.org/abs/2210.03515) </cite>\n",
"\n",
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". arXiv preprint arXiv:2109.12894, September 2021.](https://arxiv.org/abs/2109.12894) </cite>"
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". Proceedings of the IEEE, 111(9) September 2023.](https://ieeexplore.ieee.org/abstract/document/10242251) </cite>"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions examples/tutorial_regression_2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"\n",
"> <cite> [Alexander Henkes, Jason K. Eshraghian, and Henning Wessels. “Spiking neural networks for nonlinear regression\", arXiv preprint arXiv:2210.03515, October 2022.](https://arxiv.org/abs/2210.03515) </cite>\n",
"\n",
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". arXiv preprint arXiv:2109.12894, September 2021.](https://arxiv.org/abs/2109.12894) </cite>"
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". Proceedings of the IEEE, 111(9) September 2023.](https://ieeexplore.ieee.org/abstract/document/10242251) </cite>"
]
},
{
Expand Down Expand Up @@ -455,7 +455,7 @@
"outputs": [],
"source": [
"batch_size = 128\n",
"data_path='data/mnist'\n",
"data_path='tmp/data/mnist'\n",
"\n",
"# Define a transform\n",
"transform = transforms.Compose([\n",
Expand Down
3 changes: 2 additions & 1 deletion examples/tutorial_sae.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
"metadata": {},
"source": [
"For a comprehensive overview on how SNNs work, and what is going on under the hood, [then you might be interested in the snnTorch tutorial series available here.](https://snntorch.readthedocs.io/en/latest/tutorials/index.html)\n",
"\n",
"The snnTorch tutorial series is based on the following paper. If you find these resources or code useful in your work, please consider citing the following source:\n",
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". arXiv preprint arXiv:2109.12894, September 2021.](https://arxiv.org/abs/2109.12894) </cite>"
"> <cite> [Jason K. Eshraghian, Max Ward, Emre Neftci, Xinxin Wang, Gregor Lenz, Girish Dwivedi, Mohammed Bennamoun, Doo Seok Jeong, and Wei D. Lu. \"Training Spiking Neural Networks Using Lessons From Deep Learning\". Proceedings of the IEEE, 111(9) September 2023.](https://ieeexplore.ieee.org/abstract/document/10242251) </cite>"
]
},
{
Expand Down

0 comments on commit cd875a2

Please sign in to comment.