File: examples-frompapers-computing with neural synchrony-coincidence detection and synchrony_Fig5D_reproducibility.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 (56 lines) | stat: -rw-r--r-- 1,939 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
.. currentmodule:: brian

.. index::
   pair: example usage; NeuronGroup
   pair: example usage; run
   pair: example usage; show
   pair: example usage; raster_plot
   pair: example usage; linked_var
   pair: example usage; sqrt
   pair: example usage; SpikeMonitor

.. _example-frompapers-computing with neural synchrony-coincidence detection and synchrony_Fig5D_reproducibility:

Example: Fig5D_reproducibility (frompapers/computing with neural synchrony/coincidence detection and synchrony)
===============================================================================================================

Brette R (2012). Computing with neural synchrony. PLoS Comp Biol. 8(6): e1002561. doi:10.1371/journal.pcbi.1002561
------------------------------------------------------------------------------------------------------------------
Figure 5D, left.

Caption (Fig 5D). Responses of a noisy integrate-and-fire model in repeated trials.

Protocol: neuron receives input = signal + noise, both O-U processes, signal
is identical in all trials (frozen noise). The total variance is held fixed.
Signal-to-noise ratio is 3 in this simulation.

::

    from brian import *
    
    # The common noisy input
    tau_noise=5*ms
    input=NeuronGroup(1,model='dx/dt=-x/tau_noise+(2./tau_noise)**.5*xi:1')
    
    # The noisy neurons receiving the same input + independent noise
    tau=10*ms
    SNR=3. # signal to noise ratio
    sigma=.5 # total input amplitude
    Z=sigma*sqrt((tau_noise+tau)/(tau_noise*(SNR**2+1))) # normalizing factor
    eqs_neurons='''
    dx/dt=(Z*(SNR*I+u)-x)/tau:1
    du/dt=-u/tau_noise+(2./tau_noise)**.5*xi:1
    I : 1
    '''
    neurons=NeuronGroup(25,model=eqs_neurons,threshold=1,reset=0,refractory=5*ms)
    neurons.x=rand(25) # random initial conditions
    neurons.I=linked_var(input,'x')
    spikes=SpikeMonitor(neurons)
    
    run(2*second)
    
    # Figure
    raster_plot(spikes)
    show()