Skip to content

Commit

Permalink
Merge branch 'master' into push_bot_viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B authored Jan 5, 2024
2 parents 6564f50 + a5a495d commit a477e89
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 73 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout SupportScripts
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: SpiNNakerManchester/SupportScripts
path: support
Expand All @@ -40,10 +40,10 @@ jobs:
- name: Install pip, etc
uses: ./support/actions/python-tools
- name: Install Spinnaker Dependencies
uses: ./support/actions/checkout-spinn-deps
uses: ./support/actions/install-spinn-deps
with:
repositories: >
SpiNNUtils SpiNNMachine SpiNNMan PACMAN DataSpecification spalloc
SpiNNUtils SpiNNMachine SpiNNMan PACMAN spalloc
SpiNNFrontEndCommon sPyNNaker
install: true

Expand All @@ -65,9 +65,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout SupportScripts
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: SpiNNakerManchester/SupportScripts
path: support
Expand Down
1 change: 0 additions & 1 deletion .ratexcludes
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
**/SpiNNMachine/**
**/SpiNNMan/**
**/PACMAN/**
**/DataSpecification/**
**/spalloc/**
**/SpiNNFrontEndCommon/**
**/sPyNNaker/**
Expand Down
22 changes: 9 additions & 13 deletions examples/extra_models_examples/LGN_Izhikevich.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,10 @@ def print_synchrony():

""" Initialising Model connectivity parameters """

intra_pop_delay = RandomDistribution('uniform', (1, 3),
rng=NumpyRNG(seed=85520))
intra_nucleus_delay = RandomDistribution('uniform', (1, 3),
rng=NumpyRNG(seed=85521))
inter_nucleus_delay = RandomDistribution('uniform', (1, 3),
rng=NumpyRNG(seed=85522))
inter_pop_delay = RandomDistribution('uniform', (1, 3),
rng=NumpyRNG(seed=85523))
intra_pop_delay = RandomDistribution('uniform', (1, 3))
intra_nucleus_delay = RandomDistribution('uniform', (1, 3))
inter_nucleus_delay = RandomDistribution('uniform', (1, 3))
inter_pop_delay = RandomDistribution('uniform', (1, 3))
input_delay = inter_pop_delay

# # input_delay is the delay of the spike source hitting the neuronal pops
Expand Down Expand Up @@ -262,25 +258,25 @@ def print_synchrony():
NumCellsTRN = 4*scale_fact
TCR_pop = p.Population(
NumCellsTCR, p.extra_models.Izhikevich_cond, TCR_cell_params,
label='TCR_pop', initial_values=TCR_initial_values)
label='TCR_pop', initial_values=TCR_initial_values, seed=85520)
IN_pop = p.Population(
NumCellsIN, p.extra_models.Izhikevich_cond, IN_cell_params,
label='IN_pop', initial_values=IN_initial_values)
label='IN_pop', initial_values=IN_initial_values, seed=85521)
TRN_pop = p.Population(
NumCellsTRN, p.extra_models.Izhikevich_cond, TRN_cell_params,
label='TRN_pop', initial_values=TRN_initial_values)
label='TRN_pop', initial_values=TRN_initial_values, seed=85522)

""" Poisson input for TCR """
spike_source_TCR = p.Population(
NumCellsTCR, p.SpikeSourcePoisson(rate=10, start=Start_Inp,
duration=Duration_Inp),
label='spike_source_TCR')
label='spike_source_TCR', seed=85523)

""" Poisson input for IN """
spike_source_IN = p.Population(
NumCellsIN, p.SpikeSourcePoisson(rate=10, start=Start_Inp,
duration=Duration_Inp),
label='spike_source_IN')
label='spike_source_IN', seed=85524)

""" Poisson Source to TCR population projections """
Proj0 = p.Projection(
Expand Down
3 changes: 0 additions & 3 deletions examples/extra_models_examples/vogel_2011/spynnaker.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,3 @@ time_between_cores = 2.7

# performance controller for how much of the time step to use for sending
fraction_of_time_spike_sending = 0.99

[Mapping]
compressor = SpynnakerMachineBitFieldPairRouterCompressor
11 changes: 4 additions & 7 deletions examples/extra_models_examples/vogel_2011/vogels_2011_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import pyNN.spiNNaker as sim
from pyNN.random import NumpyRNG


# -------------------------------------------------------------------
Expand Down Expand Up @@ -45,8 +44,6 @@
# Reduce number of neurons to simulate on each core
sim.set_number_of_neurons_per_core(sim.IF_curr_exp, 100)

rng = NumpyRNG(seed=59)

# Create excitatory and inhibitory populations of neurons
ex_pop = sim.Population(NUM_EXCITATORY, model(**cell_params),
label="Excitatory", additional_parameters={"seed": 2})
Expand All @@ -57,15 +54,15 @@
ex_pop.record('spikes')

# Make excitatory->inhibitory projections
sim.Projection(ex_pop, in_pop, sim.FixedProbabilityConnector(0.02, rng=rng),
sim.Projection(ex_pop, in_pop, sim.FixedProbabilityConnector(0.02),
receptor_type='excitatory',
synapse_type=sim.StaticSynapse(weight=0.029))
sim.Projection(ex_pop, ex_pop, sim.FixedProbabilityConnector(0.02, rng=rng),
sim.Projection(ex_pop, ex_pop, sim.FixedProbabilityConnector(0.02),
receptor_type='excitatory',
synapse_type=sim.StaticSynapse(weight=0.029))

# Make inhibitory->inhibitory projections
sim.Projection(in_pop, in_pop, sim.FixedProbabilityConnector(0.02, rng=rng),
sim.Projection(in_pop, in_pop, sim.FixedProbabilityConnector(0.02),
receptor_type='inhibitory',
synapse_type=sim.StaticSynapse(weight=-0.29))

Expand All @@ -76,7 +73,7 @@
weight_dependence=sim.AdditiveWeightDependence(w_min=0.0, w_max=1.0))

# Make inhibitory->excitatory projections
sim.Projection(in_pop, ex_pop, sim.FixedProbabilityConnector(0.02, rng=rng),
sim.Projection(in_pop, ex_pop, sim.FixedProbabilityConnector(0.02),
receptor_type='inhibitory',
synapse_type=stdp_model)

Expand Down
20 changes: 9 additions & 11 deletions examples/pynnBrunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import numpy as np
import matplotlib.pyplot as plt
from pyNN.random import NumpyRNG, RandomDistribution
from pyNN.random import RandomDistribution
from pyNN.utility.plotting import Figure, Panel

simulator_Name = 'spiNNaker'
Expand Down Expand Up @@ -136,8 +136,6 @@ def poisson_generator(_rate, _rng, _t_start=0.0, _t_stop=1000.0, _debug=False):
pynn.set_number_of_neurons_per_core(pynn.IF_curr_exp, 64)
pynn.set_number_of_neurons_per_core(pynn.SpikeSourcePoisson, 64)

rng = NumpyRNG(seed=1)

exc_cell_params = {
'cm': 1.0, # pf
'tau_m': tau_m,
Expand All @@ -164,29 +162,29 @@ def poisson_generator(_rate, _rng, _t_start=0.0, _t_stop=1000.0, _debug=False):

# Set-up pynn Populations
E_pop = pynn.Population(
N_E, pynn.IF_curr_exp(**exc_cell_params), label="E_pop")
N_E, pynn.IF_curr_exp(**exc_cell_params), label="E_pop", seed=1)

I_pop = pynn.Population(
N_I, pynn.IF_curr_exp(**inh_cell_params), label="I_pop")
N_I, pynn.IF_curr_exp(**inh_cell_params), label="I_pop", seed=2)

Poiss_ext_E = pynn.Population(
N_E, pynn.SpikeSourcePoisson(rate=10.0), label="Poisson_pop_E",
additional_parameters={"seed": int(rng.next() * 0xFFFFFFFF)})
additional_parameters={"seed": 3})
Poiss_ext_I = pynn.Population(
N_I, pynn.SpikeSourcePoisson(rate=10.0), label="Poisson_pop_I",
additional_parameters={"seed": int(rng.next() * 0xFFFFFFFF)})
additional_parameters={"seed": 4})

# Connectors
E_conn = pynn.FixedProbabilityConnector(epsilon, rng=rng)
I_conn = pynn.FixedProbabilityConnector(epsilon, rng=rng)
E_conn = pynn.FixedProbabilityConnector(epsilon)
I_conn = pynn.FixedProbabilityConnector(epsilon)

# Use random delays for the external noise and
# set the inital membrance voltage below the resting potential
# to avoid the overshoot of activity in the beginning of the simulation
delay_distr = RandomDistribution('uniform', low=0.1, high=12.8, rng=rng)
delay_distr = RandomDistribution('uniform', low=0.1, high=12.8)
Ext_conn = pynn.OneToOneConnector()

uniformDistr = RandomDistribution('uniform', low=-10, high=0, rng=rng)
uniformDistr = RandomDistribution('uniform', low=-10, high=0)
E_pop.initialize(v=uniformDistr)
I_pop.initialize(v=uniformDistr)

Expand Down
20 changes: 9 additions & 11 deletions examples/split_examples/pynnBrunnelSplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import numpy as np
import matplotlib.pyplot as plt
from pyNN.random import NumpyRNG, RandomDistribution
from pyNN.random import RandomDistribution
from pyNN.utility.plotting import Figure, Panel
from spynnaker.pyNN.extra_algorithms.splitter_components import (
SplitterAbstractPopulationVertexNeuronsSynapses, SplitterPoissonDelegate)
Expand Down Expand Up @@ -139,8 +139,6 @@ def poisson_generator(rate, rng, t_start=0.0, t_stop=1000.0, array=True,
pynn.set_number_of_neurons_per_core(pynn.IF_curr_exp, 64)
pynn.set_number_of_neurons_per_core(pynn.SpikeSourcePoisson, 64)

rng = NumpyRNG(seed=1)

exc_cell_params = {
'cm': 1.0, # pf
'tau_m': tau_m,
Expand Down Expand Up @@ -169,35 +167,35 @@ def poisson_generator(rate, rng, t_start=0.0, t_stop=1000.0, array=True,
E_pop_splitter = SplitterAbstractPopulationVertexNeuronsSynapses(3, 128, False)
E_pop = pynn.Population(
N_E, pynn.IF_curr_exp(**exc_cell_params), label="E_pop",
additional_parameters={"splitter": E_pop_splitter})
additional_parameters={"splitter": E_pop_splitter}, seed=1)

I_pop_splitter = SplitterAbstractPopulationVertexNeuronsSynapses(3, 128, False)
I_pop = pynn.Population(
N_I, pynn.IF_curr_exp(**inh_cell_params), label="I_pop",
additional_parameters={"splitter": I_pop_splitter})
additional_parameters={"splitter": I_pop_splitter}, seed=2)

Poiss_ext_E_splitter = SplitterPoissonDelegate()
Poiss_ext_E = pynn.Population(
N_E, pynn.SpikeSourcePoisson(rate=10.0), label="Poisson_pop_E",
additional_parameters={"seed": int(rng.next() * 0xFFFFFFFF),
additional_parameters={"seed": 3,
"splitter": Poiss_ext_E_splitter})
Poiss_ext_I_splitter = SplitterPoissonDelegate()
Poiss_ext_I = pynn.Population(
N_I, pynn.SpikeSourcePoisson(rate=10.0), label="Poisson_pop_I",
additional_parameters={"seed": int(rng.next() * 0xFFFFFFFF),
additional_parameters={"seed": 4,
"splitter": Poiss_ext_I_splitter})

# Connectors
E_conn = pynn.FixedProbabilityConnector(epsilon, rng=rng)
I_conn = pynn.FixedProbabilityConnector(epsilon, rng=rng)
E_conn = pynn.FixedProbabilityConnector(epsilon)
I_conn = pynn.FixedProbabilityConnector(epsilon)

# Use random delays for the external noise and
# set the inital membrance voltage below the resting potential
# to avoid the overshoot of activity in the beginning of the simulation
delay_distr = RandomDistribution('uniform', low=0.1, high=12.8, rng=rng)
delay_distr = RandomDistribution('uniform', low=0.1, high=12.8)
Ext_conn = pynn.OneToOneConnector()

uniformDistr = RandomDistribution('uniform', low=-10, high=0, rng=rng)
uniformDistr = RandomDistribution('uniform', low=-10, high=0)
E_pop.initialize(v=uniformDistr)
I_pop.initialize(v=uniformDistr)

Expand Down
15 changes: 7 additions & 8 deletions examples/split_examples/va_benchmark_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"""
import socket
import pyNN.spiNNaker as p
from pyNN.random import NumpyRNG, RandomDistribution
from pyNN.random import RandomDistribution
from pyNN.utility import Timer
from pyNN.utility.plotting import Figure, Panel
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -161,30 +161,29 @@
exc_cells_splitter = SplitterAbstractPopulationVertexNeuronsSynapses(2)
exc_cells = p.Population(
n_exc, celltype(**cell_params), label="Excitatory_Cells",
additional_parameters={"splitter": exc_cells_splitter})
additional_parameters={"splitter": exc_cells_splitter}, seed=1)
inh_cells_splitter = SplitterAbstractPopulationVertexNeuronsSynapses(3)
inh_cells = p.Population(
n_inh, celltype(**cell_params), label="Inhibitory_Cells",
additional_parameters={"splitter": inh_cells_splitter})
additional_parameters={"splitter": inh_cells_splitter}, seed=2)
exc_conn = None
ext_stim = None
if benchmark == "COBA":
ext_stim = p.Population(
20, p.SpikeSourcePoisson(rate=rate, duration=stim_dur),
label="expoisson")
label="expoisson", seed=3)
rconn = 0.01
ext_conn = p.FixedProbabilityConnector(rconn)
ext_stim.record("spikes")

print("%s Initialising membrane potential to random values..." % node_id)
rng = NumpyRNG(seed=rngseed, parallel_safe=parallel_safe)
uniformDistr = RandomDistribution('uniform', [v_reset, v_thresh], rng=rng)
uniformDistr = RandomDistribution('uniform', [v_reset, v_thresh])
exc_cells.initialize(v=uniformDistr)
inh_cells.initialize(v=uniformDistr)

print("%s Connecting populations..." % node_id)
exc_conn = p.FixedProbabilityConnector(pconn, rng=rng)
inh_conn = p.FixedProbabilityConnector(pconn, rng=rng)
exc_conn = p.FixedProbabilityConnector(pconn)
inh_conn = p.FixedProbabilityConnector(pconn)

connections = {
'e2e': p.Projection(
Expand Down
15 changes: 7 additions & 8 deletions examples/va_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"""
import socket
import pyNN.spiNNaker as p
from pyNN.random import NumpyRNG, RandomDistribution
from pyNN.random import RandomDistribution
from pyNN.utility import Timer
from pyNN.utility.plotting import Figure, Panel
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -157,28 +157,27 @@

print("%s Creating cell populations..." % node_id)
exc_cells = p.Population(
n_exc, celltype(**cell_params), label="Excitatory_Cells")
n_exc, celltype(**cell_params), label="Excitatory_Cells", seed=1)
inh_cells = p.Population(
n_inh, celltype(**cell_params), label="Inhibitory_Cells")
n_inh, celltype(**cell_params), label="Inhibitory_Cells", seed=2)
exc_conn = None
ext_stim = None
if benchmark == "COBA":
ext_stim = p.Population(
20, p.SpikeSourcePoisson(rate=rate, duration=stim_dur),
label="expoisson")
label="expoisson", seed=3)
rconn = 0.01
ext_conn = p.FixedProbabilityConnector(rconn)
ext_stim.record("spikes")

print("%s Initialising membrane potential to random values..." % node_id)
rng = NumpyRNG(seed=rngseed, parallel_safe=parallel_safe)
uniformDistr = RandomDistribution('uniform', [v_reset, v_thresh], rng=rng)
uniformDistr = RandomDistribution('uniform', [v_reset, v_thresh])
exc_cells.initialize(v=uniformDistr)
inh_cells.initialize(v=uniformDistr)

print("%s Connecting populations..." % node_id)
exc_conn = p.FixedProbabilityConnector(pconn, rng=rng)
inh_conn = p.FixedProbabilityConnector(pconn, rng=rng)
exc_conn = p.FixedProbabilityConnector(pconn)
inh_conn = p.FixedProbabilityConnector(pconn)

connections = {
'e2e': p.Projection(
Expand Down
4 changes: 0 additions & 4 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

coverage >= 4.4, < 5.0
flake8
# pytest will be brought in by pytest-cov
pytest-cov
sphinx >= 2
pylint
testfixtures

0 comments on commit a477e89

Please sign in to comment.