From e65835e85e2d44969bfc26f873a4de176c483410 Mon Sep 17 00:00:00 2001 From: Mazdak Fatahi <mazdak.fatahi@univ-lille.fr> Date: Sat, 19 Nov 2022 17:49:10 +0100 Subject: [PATCH] Update SpiNNaker/SpiNNakerRun.ipynb --- SpiNNaker/SpiNNakerRun.ipynb | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/SpiNNaker/SpiNNakerRun.ipynb b/SpiNNaker/SpiNNakerRun.ipynb index b40d6a6..8f63e6c 100644 --- a/SpiNNaker/SpiNNakerRun.ipynb +++ b/SpiNNaker/SpiNNakerRun.ipynb @@ -30,18 +30,24 @@ "\n" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Initialization\n" + ] + }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ - "# Initialization\n", "\n", "# Encoding parameters\n", - "SMAPLES_INTERVAL=10#\n", + "SMAPLES_INTERVAL=10\n", "TIME_STEP=1\n", - "NUM_STEPS=20#20\n", + "NUM_STEPS=20\n", "\n", "# Simulator parameters\n", "timestep=[1]\n", @@ -61,6 +67,14 @@ "os.mkdir(f'{path}/{str(now)}') " ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Dataset and preparation\n", + "#### Passing data (Ex. mnistTest.data[0:10]: 10 digits from test set of MNIST dataset) to convert_to_latency_code_V4, to generate SpikeSourcArray for input population " + ] + }, { "cell_type": "code", "execution_count": 7, @@ -75,7 +89,6 @@ } ], "source": [ - "# Dataset and preparation\n", "transform=transforms.Compose([\n", " transforms.Resize((28,28)),\n", " transforms.Grayscale(),\n", @@ -90,6 +103,16 @@ "runtime =time" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Main loop\n", + "#### Will call the sim.run for different values (from range(5,10,5)) for **tau_refrac**\n", + "#### Also using other loops you can see the effects of other Simulator (number_of_neurons_per_core, time_step, timeScaleFactor) or neuron parameters\n", + "#### weights_files (generated from the CSNN binary weight files) is used for loading the text files as the connections between the popoulations" + ] + }, { "cell_type": "code", "execution_count": null, @@ -687,7 +710,6 @@ " if not os.path.exists(f'{path}/{str(now)}/{param_name}_{str(param_val)}/{str(time)}'): # 2\n", " os.mkdir(f'{path}/{str(now)}/{param_name}_{str(param_val)}/{str(time)}')\n", "\n", - " total_mem=[]\n", " spikes_count=[[] for _ in range(len(tests_name))]\n", " for n_test, test_name in enumerate(tests_name):\n", "\n", -- GitLab