Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge in Intro lab #114

Merged
merged 234 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
234 commits
Select commit Hold shift + click to select a range
9e53bd4
Added synfire example
rowleya Aug 22, 2016
2afd9a2
Removed spike printing
rowleya Aug 22, 2016
612c386
Adding sudoku
rowleya Aug 22, 2016
654a118
Updated detection of system
rowleya Aug 23, 2016
6be1282
Fixed for linux
rowleya Aug 23, 2016
3f1249c
Updated permissions
rowleya Aug 23, 2016
d56fe01
Adding OSX binary
Aug 22, 2016
f92a1c1
Added the ray tracer demo
rowleya Aug 23, 2016
dc66f75
Added linux drawer
rowleya Aug 23, 2016
ee30876
Adding mac drawer
Aug 23, 2016
6829521
Changes to make sudoku work on a single board
rowleya Sep 1, 2016
c22579d
Added an easier problem (still not solved)
rowleya Sep 1, 2016
31fcab8
Added heat demo
rowleya Sep 1, 2016
a0070e2
osx vis remake
Sep 1, 2016
2f8a9fd
Merge branch 'master' into sudoku_single_board
rowleya Sep 1, 2016
14978dd
Added learning example
rowleya Sep 1, 2016
35f4dec
Merge branch 'master' into sudoku_single_board
rowleya Sep 1, 2016
d7ae863
Updated to allow interaction
rowleya Sep 1, 2016
f9a1b7b
Disabled the output graph at the end
rowleya Sep 1, 2016
9fc1cba
fixes to heat demo for different versions of linux
alan-stokes Sep 2, 2016
7fac2b6
Working version on 4-node board
rowleya Sep 4, 2016
052f8a6
Allowed operation of dream problem
rowleya Sep 4, 2016
bd1f9ee
Adding linux visualiser
rowleya Sep 4, 2016
a8eadf0
Merge branch 'master' of https://github.com/SpiNNakerManchester/Intro…
rowleya Sep 4, 2016
56c93aa
Updated linux visualiser
rowleya Sep 4, 2016
c86dc02
updating osx permissions
Sep 4, 2016
5c6c26a
most of python i think is fixed, just need to build c code to reflect…
alan-stokes Sep 19, 2016
caf08b5
fixing iptag changes
alan-stokes Nov 1, 2016
55f1005
Changed methods into properties
rowleya Nov 11, 2016
17c1eb7
Merge pull request #1 from SpiNNakerManchester/recording_no_state_region
rowleya Nov 11, 2016
2be514a
Updated to match changes in GFE
rowleya Dec 2, 2016
66f858e
Merge remote-tracking branch 'remotes/origin/master' into dynamic_ports
alan-stokes Dec 13, 2016
0c09912
Merge remote-tracking branch 'origin/dynamic_ports' into dynamic_ports
alan-stokes Dec 13, 2016
7203c9d
Merge remote-tracking branch 'remotes/origin/master' into dynamic_ports
alan-stokes Dec 13, 2016
e03c8f0
rewired for different support of the executable types.
alan-stokes Dec 15, 2016
da6190f
Merge pull request #2 from SpiNNakerManchester/dynamic_ports
rowleya Dec 21, 2016
f18a53d
Updated the demos for the change in the API
rowleya Mar 2, 2017
fdbe792
Fixed some issues with imports
rowleya Apr 2, 2017
415807e
Updated sudoku exe
rowleya May 2, 2017
66eec46
Fixed by removing reinjection
rowleya May 2, 2017
4676e18
Fixed heat demo with placements
rowleya May 2, 2017
f3645a2
Merge pull request #3 from SpiNNakerManchester/router-compressor_on_chip
rowleya May 2, 2017
2913b0f
pep8
Christian-B May 30, 2017
6af5f98
just flake8 for now
Christian-B May 31, 2017
737c041
intentional pep8 error to test travis
Christian-B May 31, 2017
82b726d
pep8
Christian-B May 31, 2017
5dcab04
travis check
Christian-B May 31, 2017
d85f442
pep8
Christian-B May 31, 2017
a68b005
Merge pull request #4 from SpiNNakerManchester/pep8
dkfellows May 31, 2017
421a2c6
pep8
Christian-B Aug 9, 2017
507fe82
Working towards using the new visualiser for labs. NOT FINISHED!
dkfellows Aug 17, 2017
29a54f3
Use the new visualiser for labs.
dkfellows Aug 18, 2017
24cd7b4
Added message before error
Christian-B Aug 21, 2017
87f9d41
backup to old visuliser if new one fails
Christian-B Aug 22, 2017
ec43041
pep8
Christian-B Aug 22, 2017
edaf86a
updated to pynn0.8
Christian-B Aug 22, 2017
c9abdd5
pynn0.8 with a few options
Christian-B Aug 23, 2017
48f8115
fixed import
Christian-B Aug 23, 2017
baff921
Merge pull request #8 from SpiNNakerManchester/new-sudoku-visualiser
rowleya Aug 23, 2017
31520ab
updated to pynn0.8
Christian-B Aug 23, 2017
788f034
Merge remote-tracking branch 'remotes/origin/master' into pynn8
Christian-B Aug 23, 2017
2d5b3bd
Stopped Suduko Cheating and added puzzels
Christian-B Aug 24, 2017
a1179ea
pep8
Christian-B Aug 24, 2017
61e54ad
Fixed plotting
rowleya Aug 24, 2017
d780fce
Made the neo graph look better (but still not using it ;)
rowleya Aug 25, 2017
3a13057
Removed listen thread as breaks on windows
rowleya Aug 25, 2017
6086766
Removed unused import
rowleya Aug 25, 2017
a961bc6
Merge pull request #10 from SpiNNakerManchester/pynn8
rowleya Aug 25, 2017
2a22c6c
added LICENSE.md
Christian-B Aug 25, 2017
873e301
Merge remote-tracking branch 'origin/master'
Christian-B Aug 25, 2017
e33f64d
Add config to disable reinjection, as this causes dropped packets
rowleya Aug 25, 2017
51630a4
Merge branch 'master' of https://github.com/SpiNNakerManchester/Intro…
rowleya Aug 25, 2017
5a6a4d4
simple example
Christian-B Sep 8, 2017
b67b686
flake8 and change graph order
Christian-B Sep 11, 2017
6ea0d15
intro to python
Christian-B Sep 11, 2017
39bdb52
added intro example
Christian-B Sep 12, 2017
4bbeae2
Changed best method to filer(name=...)[0]
Christian-B Sep 13, 2017
c67f5a5
Add hardest sudoku, correct a few spelling mistakes
andrewgait Sep 14, 2017
ae34337
Merge pull request #12 from SpiNNakerManchester/add_hardest_sudoku
rowleya Sep 15, 2017
fa03eca
Removed non-neural and added Balanced random network
rowleya Sep 15, 2017
3bf00a7
Added network
rowleya Sep 15, 2017
9289d14
Updated parameters
rowleya Sep 16, 2017
ebd205d
Merge pull request #13 from SpiNNakerManchester/neural_intro_lab
Christian-B Sep 18, 2017
7b80b18
Get the time before ending the simulation
rowleya Sep 18, 2017
61481b8
Added spikes_per_second to indicate the potential incoming rate
rowleya Sep 18, 2017
844b768
changed marker size
Christian-B Sep 25, 2017
0c71fe1
Removed as no longer relevant
rowleya Sep 25, 2017
a3fb2fc
Added example for collab submission
rowleya Sep 28, 2017
4929214
python 3
Christian-B May 4, 2018
c244ed8
print(..)
Christian-B May 4, 2018
6204457
Updates to match recent changes to sPyNNaker
andrewgait Oct 9, 2018
1968ba6
flake8 missing blank line
andrewgait Oct 9, 2018
6530978
Merge pull request #15 from SpiNNakerManchester/update_to_match_new_api
rowleya Oct 9, 2018
80bf062
Add SpiNNaker start script
rowleya Oct 15, 2018
5828d13
Attempt to fix to work with less connections and threads
rowleya Oct 23, 2018
0e2a019
Capture error on send
rowleya Oct 30, 2018
184669f
Back to threads
rowleya Oct 30, 2018
d6432d0
Updated to include load and save
rowleya Oct 31, 2018
44d4f2f
Flake 8
rowleya Oct 31, 2018
5f90c2e
Merge branch 'master' into spinnaker_start
rowleya Oct 31, 2018
c59aa02
Update sudoku to allow changing
rowleya Nov 2, 2018
932b4a7
Updated rate and made cycle after no interaction
rowleya Nov 2, 2018
3aa42e3
use import matplotlib.pyplot
Christian-B Mar 5, 2019
ba458fd
flake8
Christian-B Mar 5, 2019
10892d7
call matplotlib the same way for testing
Christian-B Apr 4, 2019
02c1e4d
Merge pull request #16 from SpiNNakerManchester/jenkins2
rowleya Apr 12, 2019
eaddcce
Change timeout
rowleya Jul 26, 2019
d8131a5
end missing
Christian-B Feb 25, 2020
0c5e901
Upgrade the version of Python in use for flake8
dkfellows Aug 14, 2020
c4ac44f
copyrights
Christian-B Nov 9, 2020
f3b002a
python actions
Christian-B Nov 9, 2020
d8172bf
pip install lint tools
Christian-B Nov 9, 2020
0fa35fb
flake8 all
Christian-B Nov 9, 2020
c6380b4
pylint all
Christian-B Nov 9, 2020
6955b2b
pylint paths
Christian-B Nov 9, 2020
0be4b3e
disable pylint
Christian-B Nov 9, 2020
7aafb8a
enable pylint
Christian-B Nov 9, 2020
8210262
install flake8
Christian-B Nov 9, 2020
3b71219
not possible to run pylint due to poor neo code
Christian-B Nov 9, 2020
81cef6e
tell pylint that neo is not good enough
Christian-B Nov 9, 2020
2e72ad3
dont rat .pylintc
Christian-B Nov 9, 2020
65644e7
added init files
Christian-B Nov 9, 2020
546be03
ok pylint appears to work. (except neo)
Christian-B Nov 9, 2020
4e203f0
use gitclone2
Christian-B Nov 10, 2020
cb11abf
no cfg needed
Christian-B Nov 10, 2020
baa4f7a
Merge pull request #19 from SpiNNakerManchester/actions1
andrewgait Nov 10, 2020
d6739d5
Convert to use new actions
dkfellows Dec 17, 2020
d8a0680
Merge pull request #20 from SpiNNakerManchester/setup-action-intro
dkfellows Dec 17, 2020
64d4b44
Turn off automated testing with 2.7
dkfellows Jan 26, 2021
330924c
use moved neo_convertor
Christian-B Feb 8, 2021
ce7239d
Revert "use moved neo_convertor"
Christian-B Feb 8, 2021
fc78a3b
use moved neo_convertor
Christian-B Feb 9, 2021
6bd0020
Merge pull request #22 from SpiNNakerManchester/more_spy8_moves
alan-stokes Feb 10, 2021
eb132f9
Merge pull request #21 from SpiNNakerManchester/end-27
Christian-B Feb 12, 2021
3c4431c
added 3.9 and rat 3.8
Christian-B Feb 15, 2021
0c09009
Merge pull request #23 from SpiNNakerManchester/test_3_9
dkfellows Feb 16, 2021
7b01a82
added scripts testing
Christian-B Feb 17, 2021
6043cf4
added a check to make sure rebuilt
Christian-B Feb 17, 2021
204f697
removed check to make sure rebuilt
Christian-B Feb 17, 2021
2c9d4e0
flake8
Christian-B Feb 17, 2021
7d3dfbc
add support of too_long and excludes even if not used
Christian-B Feb 18, 2021
2d4b373
Merge pull request #24 from SpiNNakerManchester/test_base
rowleya Feb 23, 2021
2de8012
matplotlib install
Christian-B Feb 24, 2021
7a7a9a2
Merge pull request #25 from SpiNNakerManchester/matplotlib
Christian-B Feb 25, 2021
c165680
Create README.md
Christian-B Apr 13, 2021
826dea6
Merge pull request #26 from SpiNNakerManchester/readme
Christian-B Apr 13, 2021
908e634
Add struct examples to learning, and add split versions to test
rowleya May 25, 2021
3767296
Merge branch 'master' into split_synapse_neuron_models
rowleya May 25, 2021
11d5ba6
Merge branch 'master' into split_synapse_neuron_models
rowleya Jun 9, 2021
f28448c
Merge branch 'split_synapse_neuron_models' of https://github.com/SpiN…
rowleya Jun 9, 2021
5c3bbf7
remove max_delay from examples
Christian-B Jun 23, 2021
90ebae7
Merge pull request #27 from SpiNNakerManchester/split_synapse_neuron_…
andrewgait Jun 30, 2021
0168319
merged in master
Christian-B Jul 1, 2021
d37e813
Merge pull request #28 from SpiNNakerManchester/max_delay
rowleya Jul 8, 2021
ca30bcc
import pyNN.spiNNaker
Christian-B Mar 31, 2022
97ff129
import pyNN.spiNNaker
Christian-B Apr 1, 2022
c0bd0b5
setup pynn
Christian-B Apr 11, 2022
27aaea6
external device move in another pr
Christian-B Apr 11, 2022
61a5d4b
install spinnaker before matplotlib to cap numpy
Christian-B Apr 11, 2022
bf94743
test python 3.10 and not 3.6
Christian-B Apr 11, 2022
5e79680
3.10 needs to be a String!
Christian-B Apr 11, 2022
ec0053f
Merge pull request #29 from SpiNNakerManchester/matplotlib_after_our_…
dkfellows Apr 11, 2022
6943042
merge
Christian-B Apr 11, 2022
e0955e5
merge
Christian-B Apr 11, 2022
46f1ab3
sPyNNaker8 repository is empty!
Christian-B Apr 13, 2022
0e2fe66
Merge pull request #31 from SpiNNakerManchester/remove_sPyNNaker8
andrewgait Apr 14, 2022
b2e0fab
merged in master
Christian-B Apr 14, 2022
87e47a8
Merge pull request #30 from SpiNNakerManchester/import_pyNN.spiNNaker
rowleya Apr 21, 2022
f2fc53b
moved spynakker8 import
Christian-B May 4, 2022
dcc0e33
Merge pull request #32 from SpiNNakerManchester/less8
rowleya May 4, 2022
d875435
actions/setup-python@v4 actions/checkout@v3
Christian-B Oct 14, 2022
8061245
actions/setup-python@v4 actions/checkout@v3
Christian-B Oct 14, 2022
8f1dc33
Merge pull request #33 from SpiNNakerManchester/checkout
Christian-B Oct 14, 2022
dbaca0f
support python 3.11
Christian-B Dec 1, 2022
5c987bd
Merge pull request #34 from SpiNNakerManchester/python3.11
Christian-B Dec 2, 2022
9ea9088
strict pylint
Christian-B Jan 9, 2023
79825a3
pylint fix
Christian-B Jan 9, 2023
3f68bd1
pylint fixes
Christian-B Jan 9, 2023
82ed314
flake8
Christian-B Jan 10, 2023
5d05ee3
Merge pull request #35 from SpiNNakerManchester/pylint_fix
rowleya Jan 11, 2023
dddb57e
fixed broad-exception-raised
Christian-B Feb 2, 2023
b1e8eb5
Merge pull request #37 from SpiNNakerManchester/pylint2.16.5
Christian-B Feb 2, 2023
5be9cd5
only allow apache 2 licence
Christian-B Feb 10, 2023
6f8cdf2
added license
Christian-B Feb 10, 2023
2d77c18
Merge branch 'master' into spinnaker_start
rowleya Feb 10, 2023
bffb371
only allow apache 2 licence
Christian-B Feb 13, 2023
bc24be3
apply apache 2 license
Christian-B Feb 13, 2023
9e1c51f
change copyright date to earlier based on first git commit.
Christian-B Feb 13, 2023
6a791ee
Fix sudoku at least on linux!
rowleya Feb 13, 2023
57d2095
Merge pull request #39 from SpiNNakerManchester/apache2
Christian-B Feb 13, 2023
8ee95c1
Revert and fix copyright date to a single date
Christian-B Feb 15, 2023
de47af3
Add poisson size
rowleya Feb 15, 2023
57d64a1
Add pendulum (no spikes.csv file though)
rowleya Feb 15, 2023
88bd920
Merge pull request #41 from SpiNNakerManchester/first_dates
Christian-B Feb 16, 2023
9640b57
add badge
Christian-B Feb 20, 2023
1005fa7
Merge pull request #42 from SpiNNakerManchester/badge
Christian-B Feb 20, 2023
ede9a5f
convert to https://www.apache.org/licenses/LICENSE-2.0
Christian-B Mar 7, 2023
c5ead7f
Moved and fixed LICENSE.md
Christian-B Mar 7, 2023
197b8fd
add and validate cititations cff
Christian-B Mar 8, 2023
4caa441
converted to https://www.apache.org/licenses/
Christian-B Mar 8, 2023
f2bfe99
Merge pull request #43 from SpiNNakerManchester/citation_plus
Christian-B Mar 8, 2023
e473ec5
use https
Christian-B Mar 8, 2023
aed7803
Merge pull request #44 from SpiNNakerManchester/https
Christian-B Mar 10, 2023
12f582b
Visualiser sends tag update repeatedly
rowleya Mar 16, 2023
25cefdb
Flush to make sure it gets read!
rowleya Mar 16, 2023
bd1197a
Remove memory leaks
rowleya Mar 16, 2023
401f102
install-spinn-deps
Christian-B Mar 21, 2023
91e6ddc
Merge pull request #45 from SpiNNakerManchester/pyproject.toml
Christian-B Apr 11, 2023
1f1019a
remove 3.7 testing
Christian-B May 25, 2023
067c970
Merge pull request #46 from SpiNNakerManchester/no3.7
Christian-B May 25, 2023
69c0a12
Fix seeding
rowleya Jun 15, 2023
3070f63
Merge pull request #47 from SpiNNakerManchester/rng_warnings
rowleya Jun 15, 2023
3de1edb
remove links to DataSpecifation reporitory
Christian-B Jun 20, 2023
84eca5b
Merge pull request #48 from SpiNNakerManchester/DataType
Christian-B Jun 21, 2023
4636cf6
checkout@v4
Christian-B Sep 11, 2023
552c5eb
Merge pull request #49 from SpiNNakerManchester/checkout@v4
Christian-B Sep 11, 2023
b86b0ed
don't use getWeights()
Christian-B Sep 26, 2023
b7759c4
format="list"
Christian-B Sep 26, 2023
88dba50
Merge pull request #50 from SpiNNakerManchester/deprecated
rowleya Oct 9, 2023
fdce7c7
python 3.12
Christian-B Jan 2, 2024
df6a8d0
Merge pull request #51 from SpiNNakerManchester/python3.12
Christian-B Jan 5, 2024
d441ecc
Merge branch 'master' into spinnaker_start
rowleya Mar 7, 2024
24b246f
Fix this (not sure why it is like this)
rowleya Mar 7, 2024
f7b5c32
Try to pass tests!
rowleya Mar 7, 2024
ba75867
This too
rowleya Mar 7, 2024
c26008a
Flake8
rowleya Mar 7, 2024
1f5deb6
Don't exit so quickly
rowleya Mar 15, 2024
7bb5246
Fix issues with examples
rowleya Mar 15, 2024
874e7a3
update to actions/setup-python@v5
Christian-B Apr 22, 2024
e33af57
Merge pull request #54 from SpiNNakerManchester/actions/setup-python@v5
Christian-B Apr 22, 2024
e2e2ece
Merge branch 'master' into spinnaker_start
Christian-B May 7, 2024
c565653
Merge pull request #52 from SpiNNakerManchester/spinnaker_start
Christian-B May 7, 2024
3c17f45
merge in IntroLabs
Christian-B May 7, 2024
6364552
fix action file
Christian-B May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ jobs:
uses: ./support/actions/install-matplotlib

- name: Lint with flake8
run: flake8 examples
run: flake8 examples balanced_random learning sudoku synfire

- name: Lint with pylint
uses: ./support/actions/pylint
with:
package: examples
package: examples balanced_random learning sudoku synfire
exitcheck: 39

validate:
Expand All @@ -72,9 +72,11 @@ jobs:
repository: SpiNNakerManchester/SupportScripts
path: support
- name: Run rat copyright enforcement
if: matrix.python-version == 3.12
uses: ./support/actions/check-copyrights
with:
config_file: rat_asl20.xml

- name: Validate CITATION.cff
if: matrix.python-version == 3.12
uses: dieghernan/cff-validator@main
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ __pycache__
.pytest_cache
*application_generated_data_files/
*reports/
.cache/
.mypy_cache/
7 changes: 7 additions & 0 deletions .ratexcludes
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@
**/SpiNNFrontEndCommon/**
**/sPyNNaker/**
**/sPyNNaker8/**
**/.pylintrc
**/*.dll
**/*.exe
**/*.png
**/*linux
**/*osx
**/*.exe
**/.pylintrc
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ contact:
name: SpiNNaker Software Team
post-code: M13 9PL
license: Apache-2.0
repository: https://github.com/SpiNNakerManchester/PyNN8Examples
repository: https://github.com/SpiNNakerManchester/PyNNExamples
13 changes: 13 additions & 0 deletions balanced_random/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2017 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
111 changes: 111 additions & 0 deletions balanced_random/balanced_random.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Copyright (c) 2017 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import matplotlib.pyplot as pylab
import numpy
from pyNN.random import RandomDistribution
from pyNN.utility.plotting import Figure, Panel
import pyNN.spiNNaker as p

p.setup(timestep=0.1)
p.set_number_of_neurons_per_core(p.IF_curr_exp, 64)
p.set_number_of_neurons_per_core(p.SpikeSourcePoisson, 64)
n_neurons = 500
n_exc = int(round(n_neurons * 0.8))
n_inh = int(round(n_neurons * 0.2))
weight_exc = 0.1
weight_inh = -5.0 * weight_exc
weight_input = 0.001

pop_input = p.Population(100, p.SpikeSourcePoisson(rate=0.0),
additional_parameters={
"max_rate": 50.0,
"seed": 0},
label="Input")

pop_exc = p.Population(n_exc, p.IF_curr_exp, label="Excitatory", seed=1)
pop_inh = p.Population(n_inh, p.IF_curr_exp, label="Inhibitory", seed=2)
stim_exc = p.Population(
n_exc, p.SpikeSourcePoisson(rate=1000.0), label="Stim_Exc",
additional_parameters={"seed": 3})
stim_inh = p.Population(
n_inh, p.SpikeSourcePoisson(rate=1000.0), label="Stim_Inh",
additional_parameters={"seed": 4})

delays_exc = RandomDistribution(
"normal_clipped", mu=1.5, sigma=0.75, low=1.0, high=1.6)
weights_exc = RandomDistribution(
"normal_clipped", mu=weight_exc, sigma=0.1, low=0, high=numpy.inf)
conn_exc = p.FixedProbabilityConnector(0.1)
synapse_exc = p.StaticSynapse(weight=weights_exc, delay=delays_exc)
delays_inh = RandomDistribution(
"normal_clipped", mu=0.75, sigma=0.375, low=1.0, high=1.6)
weights_inh = RandomDistribution(
"normal_clipped", mu=weight_inh, sigma=0.1, low=-numpy.inf, high=0)
conn_inh = p.FixedProbabilityConnector(0.1)
synapse_inh = p.StaticSynapse(weight=weights_inh, delay=delays_inh)
p.Projection(
pop_exc, pop_exc, conn_exc, synapse_exc, receptor_type="excitatory")
p.Projection(
pop_exc, pop_inh, conn_exc, synapse_exc, receptor_type="excitatory")
p.Projection(
pop_inh, pop_inh, conn_inh, synapse_inh, receptor_type="inhibitory")
p.Projection(
pop_inh, pop_exc, conn_inh, synapse_inh, receptor_type="inhibitory")

conn_stim = p.OneToOneConnector()
synapse_stim = p.StaticSynapse(weight=weight_exc, delay=1.0)
p.Projection(
stim_exc, pop_exc, conn_stim, synapse_stim, receptor_type="excitatory")
p.Projection(
stim_inh, pop_inh, conn_stim, synapse_stim, receptor_type="excitatory")

delays_input = RandomDistribution(
"normal_clipped", mu=1.5, sigma=0.75, low=1.0, high=1.6)
weights_input = RandomDistribution(
"normal_clipped", mu=weight_input, sigma=0.01, low=0, high=numpy.inf)
p.Projection(pop_input, pop_exc, p.AllToAllConnector(), p.StaticSynapse(
weight=weights_input, delay=delays_input))

pop_exc.initialize(
v=RandomDistribution("uniform", low=-65.0, high=-55.0))
pop_inh.initialize(
v=RandomDistribution("uniform", low=-65.0, high=-55.0))

pop_exc.record("spikes")

p.run(1000)

pop_input.set(rate=50.0)
p.run(1000)

pop_input.set(rate=10.0)
p.run(1000)

pop_input.set(rate=20.0)
p.run(1000)

data = pop_exc.get_data("spikes")
end_time = p.get_current_time()

p.end()

Figure(
# raster plot of the presynaptic neuron spike times
Panel(data.segments[0].spiketrains,
yticks=True, markersize=2.0, xlim=(0, end_time)),
title="Balanced Random Network",
annotations="Simulated with {}".format(p.name())
)
pylab.show()
118 changes: 118 additions & 0 deletions balanced_random/split/balanced_random_split.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import pylab
import numpy
from pyNN.random import RandomDistribution
from pyNN.utility.plotting import Figure, Panel
import pyNN.spiNNaker as p
from spynnaker.pyNN.extra_algorithms.splitter_components import (
SplitterPoissonDelegate, SplitterAbstractPopulationVertexNeuronsSynapses)

p.setup(timestep=0.1, time_scale_factor=1)
p.set_number_of_neurons_per_core(p.IF_curr_exp, 64)
p.set_number_of_neurons_per_core(p.SpikeSourcePoisson, 64)
n_neurons = 500
n_exc = int(round(n_neurons * 0.8))
n_inh = int(round(n_neurons * 0.2))
weight_exc = 0.1
weight_inh = -5.0 * weight_exc
weight_input = 0.001

pop_input_splitter = SplitterPoissonDelegate()
pop_input = p.Population(100, p.SpikeSourcePoisson(rate=0.0),
additional_parameters={
"max_rate": 50.0,
"seed": 0,
"splitter": pop_input_splitter},
label="Input")

pop_exc_splitter = \
SplitterAbstractPopulationVertexNeuronsSynapses(1, 128, False)
pop_exc = p.Population(n_exc, p.IF_curr_exp, label="Excitatory",
additional_parameters={"splitter": pop_exc_splitter,
"seed": 1})
pop_inh_splitter = \
SplitterAbstractPopulationVertexNeuronsSynapses(1, 128, False)
pop_inh = p.Population(n_inh, p.IF_curr_exp, label="Inhibitory",
additional_parameters={"splitter": pop_inh_splitter,
"seed": 2})
stim_exc_splitter = SplitterPoissonDelegate()
stim_exc = p.Population(
n_exc, p.SpikeSourcePoisson(rate=1000.0), label="Stim_Exc",
additional_parameters={"seed": 3, "splitter": stim_exc_splitter})
stim_inh_splitter = SplitterPoissonDelegate()
stim_inh = p.Population(
n_inh, p.SpikeSourcePoisson(rate=1000.0), label="Stim_Inh",
additional_parameters={"seed": 4, "splitter": stim_inh_splitter})

delays_exc = RandomDistribution(
"normal_clipped", mu=1.5, sigma=0.75, low=1.0, high=1.6)
weights_exc = RandomDistribution(
"normal_clipped", mu=weight_exc, sigma=0.1, low=0, high=numpy.inf)
conn_exc = p.FixedProbabilityConnector(0.1)
synapse_exc = p.StaticSynapse(weight=weights_exc, delay=delays_exc)
delays_inh = RandomDistribution(
"normal_clipped", mu=0.75, sigma=0.375, low=1.0, high=1.6)
weights_inh = RandomDistribution(
"normal_clipped", mu=weight_inh, sigma=0.1, low=-numpy.inf, high=0)
conn_inh = p.FixedProbabilityConnector(0.1)
synapse_inh = p.StaticSynapse(weight=weights_inh, delay=delays_inh)
p.Projection(
pop_exc, pop_exc, conn_exc, synapse_exc, receptor_type="excitatory",
label="exc_exc")
p.Projection(
pop_exc, pop_inh, conn_exc, synapse_exc, receptor_type="excitatory",
label="exc_inh")
p.Projection(
pop_inh, pop_inh, conn_inh, synapse_inh, receptor_type="inhibitory",
label="inh_inh")
p.Projection(
pop_inh, pop_exc, conn_inh, synapse_inh, receptor_type="inhibitory",
label="inh_exc")

conn_stim = p.OneToOneConnector()
synapse_stim = p.StaticSynapse(weight=weight_exc, delay=1.0)
p.Projection(
stim_exc, pop_exc, conn_stim, synapse_stim, receptor_type="excitatory",
label="stim_exc_exc")
p.Projection(
stim_inh, pop_inh, conn_stim, synapse_stim, receptor_type="excitatory",
label="stim_inh_inh")

delays_input = RandomDistribution(
"normal_clipped", mu=1.5, sigma=0.75, low=1.0, high=1.6)
weights_input = RandomDistribution(
"normal_clipped", mu=weight_input, sigma=0.01, low=0, high=numpy.inf)
p.Projection(pop_input, pop_exc, p.AllToAllConnector(), p.StaticSynapse(
weight=weights_input, delay=delays_input),
label="input_exc")

pop_exc.initialize(
v=RandomDistribution("uniform", low=-65.0, high=-55.0))
pop_inh.initialize(
v=RandomDistribution("uniform", low=-65.0, high=-55.0))

pop_exc.record("spikes")

p.run(1000)

pop_input.set(rate=50.0)
p.run(1000)

pop_input.set(rate=10.0)
p.run(1000)

pop_input.set(rate=20.0)
p.run(1000)

data = pop_exc.get_data("spikes")
end_time = p.get_current_time()

p.end()

Figure(
# raster plot of the presynaptic neuron spike times
Panel(data.segments[0].spiketrains,
yticks=True, markersize=2.0, xlim=(0, end_time)),
title="Balanced Random Network",
annotations="Simulated with {}".format(p.name())
)
pylab.show()
2 changes: 2 additions & 0 deletions balanced_random/split/spynnaker.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Mode]
violate_1ms_wall_clock_restriction = True
4 changes: 3 additions & 1 deletion integration_tests/script_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def build_scripts(self):
too_long = {}
too_long["stdp_triplet.py"] = "10 minutes"

self.create_test_scripts(["examples"], too_long, exceptions)
self.create_test_scripts(
["examples","balanced_random", "learning", "synfire"],
too_long, exceptions)


if __name__ == '__main__':
Expand Down
Loading