-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathone_neuron_izhikevich.py
50 lines (34 loc) · 1.49 KB
/
one_neuron_izhikevich.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import spynnaker8 as sim
# === Parameters ===============================================================
n_neurons = 1 # number of neurons in each population for the Spiking Neural Network in this example
timestamp = 1.0 # simulate the network with 1.0 ms time steps
sim_time = 10 # total simulation time
# === Configure the simulator ==================================================
sim.setup( timestamp )
# === Build the network ========================================================
# Izhikevich neuron model
"""
Notes:
* Interesting property about this neuron model: voltage_based_synapses = True
* Initial voltage value = -70.0
"""
pop_exc = sim.Population( n_neurons, sim.Izhikevich(),
label = 'pop_exc' )
# == Instrument the network ====================================================
# Record all to observe.
"""
Note:
Recordables of this neuron model are limited with voltage, spikes, and unit(mV/ms) of the population.
"""
pop_exc.record( "all" )
# === Run the simulation =======================================================
sim.run( sim_time )
# === Plot the results =========================================================
# Data of recordables
data = pop_exc.get_data().segments[0]
spiketrains = data.spiketrains
voltage = data.filter( name = 'v' )[0]
from util.basic_visualizer import *
plot( spiketrains, voltage, plot_title="Izhikevich Neuron Model" )
# === Clean up and quit ========================================================
sim.end()