Skip to content

Commit

Permalink
n_neurons = 1000 simtime = 10000 pops = 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Jul 16, 2024
1 parent 0bdf782 commit 4d35621
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
10 changes: 7 additions & 3 deletions synfire/self_synfire.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
"""
Synfire chain example
"""
import time
import matplotlib.pyplot as plt
import pyNN.spiNNaker as sim
import pyNN.utility.plotting as plot

start = time.time()
# number of neurons in each population
n_neurons = 10
simtime = 1000
n_neurons = 1000
simtime = 10000
pops = 1

sim.setup(timestep=1.0, min_delay=1.0)
Expand Down Expand Up @@ -62,4 +64,6 @@
title="Self Synfire Example",
annotations="Simulated with {}".format(sim.name())
)
plt.show()
plt.show()

print(time.time()-start)
35 changes: 19 additions & 16 deletions synfire/self_synfire2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,34 @@
"""
Synfire chain example
"""
import time
import matplotlib.pyplot as plt
import pyNN.spiNNaker as sim
import pyNN.utility.plotting as plot

start = time.time()
# number of neurons in each population
n_neurons = 10
simtime = 1000
pops = 5
n_neurons = 1000
simtime = 10000
pops = 1

sim.setup(timestep=1.0, min_delay=1.0)

spikeArray = {'spike_times': [[0]]}
stimulus = sim.Population(1, sim.SpikeSourceArray, spikeArray,
label='stimulus')

pop = sim.Population(n_neurons, sim.IF_curr_exp, {}, label='chain')
pop.record("spikes")
#pop.record(["spikes", "v"])
sim.Projection(stimulus, pop,
sim.OneToOneConnector(),
sim.StaticSynapse(weight=5, delay=1))
sim.Projection(pop[n_neurons - 1], pop[0], sim.OneToOneConnector(),
sim.StaticSynapse(weight=5, delay=1))
for i in range(n_neurons - 1):
print(i, i+1)
sim.Projection(pop[i], pop[i], sim.OneToOneConnector(),
for i in range(pops):
pop = sim.Population(n_neurons, sim.IF_curr_exp, {}, label='chain')
pop.record("spikes")
#pop.record(["spikes", "v"])
sim.Projection(stimulus, pop,
sim.OneToOneConnector(),
sim.StaticSynapse(weight=5, delay=1))
sim.Projection(pop[n_neurons - 1], pop[0], sim.OneToOneConnector(),
sim.StaticSynapse(weight=5, delay=1))
for i in range(n_neurons-1):
sim.Projection(pop[i], pop[i+1], sim.OneToOneConnector(),
sim.StaticSynapse(weight=5, delay=1))

sim.run(simtime)
neo = pop.get_data(variables=["spikes"])
Expand All @@ -60,4 +61,6 @@
title="Self Synfire Example",
annotations="Simulated with {}".format(sim.name())
)
plt.show()
plt.show()

print(time.time()-start)

0 comments on commit 4d35621

Please sign in to comment.