"#### 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",
" spikes_count=[[] for _ in range(len(tests_name))]\n",
" for n_test, test_name in enumerate(tests_name):\n",
"\n",
...
...
%% Cell type:code id: tags:
``` python
# Imports
importSpiNNakerHelpersasmySpiNNaker
importtorch
importsnntorch
fromsnntorchimportutils,spikegen
fromtorchvisionimporttransforms,datasets
frompacmanimportexceptions
fromspinn_utilities.progress_barimportProgressBar
importtime
importpyNN.utility.plottingasplot
fromtorch.utils.dataimportSubsetRandomSampler
importmatplotlib.pyplotasplt
importrandom
importtorch
importtorchvision
importnumpyasnp
importseabornassns
importos
importos.path
importdatetime
```
%% Cell type:markdown id: tags:
# Initialization
%% Cell type:code id: tags:
``` python
# Initialization
# Encoding parameters
SMAPLES_INTERVAL=10#
SMAPLES_INTERVAL=10
TIME_STEP=1
NUM_STEPS=20#20
NUM_STEPS=20
# Simulator parameters
timestep=[1]
time_scale_factor=[1]
neuron_tpye=mySpiNNaker.sim.IF_curr_exp
number_of_neurons_per_cores=[1000]
# Model Parameters
INPUT_SIZE=784
EXC_POP_SIZE=[400,1600]
INH_POP_SIZE=[]
# General parameters
path=os.getcwd()
now=datetime.datetime.now()
os.mkdir(f'{path}/{str(now)}')
```
%% Cell type:markdown id: tags:
# Dataset and preparation
#### 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
2022-11-17 13:29:49 INFO: Will search these locations for binaries: /home/bbpnrsoa/sPyNNakerGit/sPyNNaker/spynnaker/pyNN/model_binaries : /home/bbpnrsoa/sPyNNakerGit/SpiNNFrontEndCommon/spinn_front_end_common/common_model_binaries
2022-11-17 13:29:49 WARNING: /home/bbpnrsoa/FromSep2022/test_For_Paper/ForReportOnTheResults(ToSeeWaySpikesMoveUpAndDone)/improved_2/reports has 46 old reports that have not been closed
2022-11-17 13:29:49 INFO: Setting hardware timestep as 1000 microseconds based on simulation time step of 1000 and timescale factor of 1
2022-11-17 13:30:10 INFO: Fixed route router took 0:00:00.009081
Routing
|0% 50% 100%|
/home/bbpnrsoa/sPyNNakerGit/sPyNNaker/spynnaker/pyNN/models/neural_projections/connectors/from_list_connector.py:157: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
2022-11-17 13:30:19 INFO: Sdram usage per chip report took 0:00:00.087471
2022-11-17 13:30:19 INFO: Drift report skipped as cfg Reports:write_drift_report_start is False
2022-11-17 13:30:19 INFO: Creating live event connection database in /home/bbpnrsoa/FromSep2022/test_For_Paper/ForReportOnTheResults(ToSeeWaySpikesMoveUpAndDone)/improved_2/reports/2022-11-17-13-29-49-630243/run_1/input_output_database.sqlite3
2022-11-17 13:30:23 INFO: Graph provenance gatherer took 0:00:00.011807
Getting provenance data
|0% 50% 100%|
======================================================2022-11-17 13:30:23 WARNING: On Slice Slice(lo_atom=0, hi_atom=255, n_atoms=256, shape=(256,), start=(0,)) of EXC_POP_0 on 0,0,5, 156 packets were dropped from the input buffer, because they arrived too late to be processed in a given time step. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
2022-11-17 13:30:23 WARNING: A maximum of 2 background tasks were queued on Slice Slice(lo_atom=0, hi_atom=255, n_atoms=256, shape=(256,), start=(0,)) of EXC_POP_0 on 0,0,5. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
=2022-11-17 13:30:23 WARNING: On Slice Slice(lo_atom=256, hi_atom=399, n_atoms=144, shape=(144,), start=(256,)) of EXC_POP_0 on 0,0,6, 64 packets were dropped from the input buffer, because they arrived too late to be processed in a given time step. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
2022-11-17 13:30:23 WARNING: A maximum of 2 background tasks were queued on Slice Slice(lo_atom=256, hi_atom=399, n_atoms=144, shape=(144,), start=(256,)) of EXC_POP_0 on 0,0,6. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
=2022-11-17 13:30:23 WARNING: The input buffer for Slice Slice(lo_atom=0, hi_atom=255, n_atoms=256, shape=(256,), start=(0,)) of EXC_POP_1 on 0,0,7 lost packets on 1629 occasions. This is often a sign that the system is running too quickly for the number of neurons per core. Please increase the timer_tic or time_scale_factor or decrease the number of neurons per core.
2022-11-17 13:30:23 WARNING: On Slice Slice(lo_atom=0, hi_atom=255, n_atoms=256, shape=(256,), start=(0,)) of EXC_POP_1 on 0,0,7, 8147 packets were dropped from the input buffer, because they arrived too late to be processed in a given time step. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
2022-11-17 13:30:23 WARNING: A maximum of 4 background tasks were queued on Slice Slice(lo_atom=0, hi_atom=255, n_atoms=256, shape=(256,), start=(0,)) of EXC_POP_1 on 0,0,7. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
2022-11-17 13:30:23 WARNING: The input buffer for Slice Slice(lo_atom=256, hi_atom=511, n_atoms=256, shape=(256,), start=(256,)) of EXC_POP_1 on 0,0,8 lost packets on 1629 occasions. This is often a sign that the system is running too quickly for the number of neurons per core. Please increase the timer_tic or time_scale_factor or decrease the number of neurons per core.
2022-11-17 13:30:23 WARNING: On Slice Slice(lo_atom=256, hi_atom=511, n_atoms=256, shape=(256,), start=(256,)) of EXC_POP_1 on 0,0,8, 8149 packets were dropped from the input buffer, because they arrived too late to be processed in a given time step. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
2022-11-17 13:30:23 WARNING: A maximum of 4 background tasks were queued on Slice Slice(lo_atom=256, hi_atom=511, n_atoms=256, shape=(256,), start=(256,)) of EXC_POP_1 on 0,0,8. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
=2022-11-17 13:30:23 WARNING: The input buffer for Slice Slice(lo_atom=512, hi_atom=767, n_atoms=256, shape=(256,), start=(512,)) of EXC_POP_1 on 0,0,9 lost packets on 1629 occasions. This is often a sign that the system is running too quickly for the number of neurons per core. Please increase the timer_tic or time_scale_factor or decrease the number of neurons per core.
2022-11-17 13:30:23 WARNING: On Slice Slice(lo_atom=512, hi_atom=767, n_atoms=256, shape=(256,), start=(512,)) of EXC_POP_1 on 0,0,9, 8151 packets were dropped from the input buffer, because they arrived too late to be processed in a given time step. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
2022-11-17 13:30:23 WARNING: A maximum of 4 background tasks were queued on Slice Slice(lo_atom=512, hi_atom=767, n_atoms=256, shape=(256,), start=(512,)) of EXC_POP_1 on 0,0,9. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
2022-11-17 13:30:23 WARNING: The input buffer for Slice Slice(lo_atom=768, hi_atom=1023, n_atoms=256, shape=(256,), start=(768,)) of EXC_POP_1 on 0,0,10 lost packets on 1629 occasions. This is often a sign that the system is running too quickly for the number of neurons per core. Please increase the timer_tic or time_scale_factor or decrease the number of neurons per core.
2022-11-17 13:30:23 WARNING: On Slice Slice(lo_atom=768, hi_atom=1023, n_atoms=256, shape=(256,), start=(768,)) of EXC_POP_1 on 0,0,10, 8151 packets were dropped from the input buffer, because they arrived too late to be processed in a given time step. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
2022-11-17 13:30:23 WARNING: A maximum of 4 background tasks were queued on Slice Slice(lo_atom=768, hi_atom=1023, n_atoms=256, shape=(256,), start=(768,)) of EXC_POP_1 on 0,0,10. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
=2022-11-17 13:30:23 WARNING: The input buffer for Slice Slice(lo_atom=1024, hi_atom=1279, n_atoms=256, shape=(256,), start=(1024,)) of EXC_POP_1 on 0,0,11 lost packets on 1629 occasions. This is often a sign that the system is running too quickly for the number of neurons per core. Please increase the timer_tic or time_scale_factor or decrease the number of neurons per core.
2022-11-17 13:30:23 WARNING: On Slice Slice(lo_atom=1024, hi_atom=1279, n_atoms=256, shape=(256,), start=(1024,)) of EXC_POP_1 on 0,0,11, 8150 packets were dropped from the input buffer, because they arrived too late to be processed in a given time step. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
2022-11-17 13:30:23 WARNING: A maximum of 4 background tasks were queued on Slice Slice(lo_atom=1024, hi_atom=1279, n_atoms=256, shape=(256,), start=(1024,)) of EXC_POP_1 on 0,0,11. Try increasing the time_scale_factor located within the .spynnaker.cfg file or in the pynn.setup() method.
2022-11-17 13:30:23 WARNING: Additional interesting provenace items in /home/bbpnrsoa/FromSep2022/test_For_Paper/ForReportOnTheResults(ToSeeWaySpikesMoveUpAndDone)/improved_2/reports/2022-11-17-13-29-49-630243/run_1/provenance_data/provenance.sqlite3
==
2022-11-17 13:30:23 INFO: Placements provenance gatherer took 0:00:00.332423
2022-11-17 13:30:26 INFO: Will search these locations for binaries: /home/bbpnrsoa/sPyNNakerGit/sPyNNaker/spynnaker/pyNN/model_binaries : /home/bbpnrsoa/sPyNNakerGit/SpiNNFrontEndCommon/spinn_front_end_common/common_model_binaries
2022-11-17 13:30:26 WARNING: /home/bbpnrsoa/FromSep2022/test_For_Paper/ForReportOnTheResults(ToSeeWaySpikesMoveUpAndDone)/improved_2/reports has 46 old reports that have not been closed
2022-11-17 13:30:26 INFO: Setting hardware timestep as 1000 microseconds based on simulation time step of 1000 and timescale factor of 1
2022-11-17 13:30:46 INFO: Fixed route router took 0:00:00.008056
Routing
|0% 50% 100%|
/home/bbpnrsoa/sPyNNakerGit/sPyNNaker/spynnaker/pyNN/models/neural_projections/connectors/from_list_connector.py:157: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.