File: examples-synapses_probabilistic_synapses2.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 (45 lines) | stat: -rw-r--r-- 1,154 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
.. currentmodule:: brian

.. index::
   pair: example usage; NeuronGroup
   pair: example usage; run
   pair: example usage; show
   pair: example usage; raster_plot
   pair: example usage; PoissonGroup
   pair: example usage; Synapses
   pair: example usage; SpikeMonitor

.. _example-synapses_probabilistic_synapses2:

Example: probabilistic_synapses2 (synapses)
===========================================

Probabilistic synapses - Katz model

::

    from brian import *
    from numpy.random import binomial
            
    Nin=1000
    Nout=25
    input=PoissonGroup(Nin,rates=2*Hz)
    tau=10*ms
    neurons=NeuronGroup(Nout,model="dv/dt=-v/tau:1",threshold=35*50./5,reset=0)
    S=Synapses(input,neurons,model='''w:1 # PSP size for one quantum
                                      nvesicles:1 # Number of vesicles (n is reserved)
                                      p:1 # Release probability''',
                             pre ='''v+=binomial(nvesicles,p)*w''')
    S[:,:]=True # all-to-all
    S.w='rand()'
    S.nvesicles=50
    S.p='rand()'
    
    S=SpikeMonitor(neurons)
    
    run(1000*ms)
    
    raster_plot(S)
    show()