File: examples-frompapers_Rossant_et_al_2011bis.txt

package info (click to toggle)
brian 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, stretch
  • size: 23,436 kB
  • sloc: python: 68,707; cpp: 29,040; ansic: 5,182; sh: 111; makefile: 61
file content (98 lines) | stat: -rw-r--r-- 3,176 bytes parent folder | download
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
.. currentmodule:: brian

.. index::
   pair: example usage; subplot
   pair: example usage; plot
   pair: example usage; run
   pair: example usage; title
   pair: example usage; show
   pair: example usage; vstack
   pair: example usage; reinit_default_clock
   pair: example usage; PoissonInput
   pair: example usage; tile
   pair: example usage; SpikeMonitor
   pair: example usage; NeuronGroup
   pair: example usage; Equations
   pair: example usage; StateMonitor

.. _example-frompapers_Rossant_et_al_2011bis:

Example: Rossant_et_al_2011bis (frompapers)
===========================================

Distributed synchrony example
=============================
Fig. 14 from:

    Rossant C, Leijon S, Magnusson AK, Brette R (2011).
    "Sensitivity of noisy neurons to coincident inputs".
    Journal of Neuroscience, 31(47).

5000 independent E/I Poisson inputs are injected into a leaky integrate-and-fire neuron.
Synchronous events, following an independent Poisson process at 40 Hz, are considered, 
where 15 E Poisson spikes are randomly shifted to be synchronous at those events.
The output firing rate is then significantly higher, showing that the spike timing of
less than 1% of the excitatory synapses have an important impact on the postsynaptic firing.

::

    from brian import *
    
    # neuron parameters
    theta = -55*mV
    El = -65*mV
    vmean = -65*mV
    taum = 5*ms
    taue = 3*ms
    taui = 10*ms
    eqs = Equations("""
                    dv/dt  = (ge+gi-(v-El))/taum : volt
                    dge/dt = -ge/taue : volt
                    dgi/dt = -gi/taui : volt
                    """)
    
    # input parameters
    p = 15
    ne = 4000
    ni = 1000
    lambdac = 40*Hz
    lambdae = lambdai = 1*Hz
    
    # synapse parameters
    we = .5*mV/(taum/taue)**(taum/(taue-taum))
    wi = (vmean-El-lambdae*ne*we*taue)/(lambdae*ni*taui)
    
    # NeuronGroup definition
    group = NeuronGroup(N=2, model=eqs, reset=El, threshold=theta, refractory=5*ms)
    group.v = El
    group.ge = group.gi = 0
    
    # independent E/I Poisson inputs
    p1 = PoissonInput(group[0], N=ne, rate=lambdae, weight=we, state='ge')
    p2 = PoissonInput(group[0], N=ni, rate=lambdai, weight=wi, state='gi')
    
    # independent E/I Poisson inputs + synchronous E events
    p3 = PoissonInput(group[1], N=ne, rate=lambdae-(p*1.0/ne)*lambdac, weight=we, state='ge')
    p4 = PoissonInput(group[1], N=ni, rate=lambdai, weight=wi, state='gi')
    p5 = PoissonInput(group[1], N=1, rate=lambdac, weight=p*we, state='ge')
    
    # run the simulation
    reinit_default_clock()
    M = SpikeMonitor(group)
    SM = StateMonitor(group, 'v', record=True)
    run(1*second)
    
    # plot trace and spikes
    for i in [0,1]:
        spikes = M.spiketimes[i]-.0001
        val = SM.values[i]
        subplot(2,1,i+1)
        plot(SM.times, val)
        plot(tile(spikes, (2,1)), 
             vstack((val[array(spikes*10000, dtype=int)],
                     zeros(len(spikes)))), 'b')
        title("%s: %d spikes/second" % (["uncorrelated inputs", "correlated inputs"][i], 
                                        len(M.spiketimes[i])))
    show()