File: reliability.py

package info (click to toggle)
brian 2.8.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,872 kB
  • sloc: python: 51,548; cpp: 2,011; makefile: 116; sh: 64
file content (31 lines) | stat: -rwxr-xr-x 834 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/env python
"""
Reliability of spike timing.

See e.g. Mainen & Sejnowski (1995) for experimental results in vitro.
"""
from brian2 import *

# The common noisy input
N = 25
tau_input = 5*ms
neuron_input = NeuronGroup(1, 'dx/dt = -x / tau_input + (2 /tau_input)**.5 * xi : 1')

# The noisy neurons receiving the same input
tau = 10*ms
sigma = .015
eqs_neurons = '''
dx/dt = (0.9 + .5 * I - x) / tau + sigma * (2 / tau)**.5 * xi : 1
I : 1 (linked)
'''
neurons = NeuronGroup(N, model=eqs_neurons, threshold='x > 1',
                      reset='x = 0', refractory=5*ms, method='euler')
neurons.x = 'rand()'
neurons.I = linked_var(neuron_input, 'x') # input.x is continuously fed into neurons.I
spikes = SpikeMonitor(neurons)

run(500*ms)
plt.plot(spikes.t/ms, spikes.i, '.k')
xlabel('Time (ms)')
ylabel('Neuron index')
show()