Download Example - Read the Docs

Transcript
Brian Documentation, Release 1.4.1
Poisson threshold
It is possible to generate spikes with a given probability rather than when a threshold condition is met, by using the
class PoissonThreshold, as in the following example:
group=NeuronGroup(100,model='x : Hz',threshold=PoissonThreshold(state='x'))
x=linspace(0*Hz,10*Hz,100)
Here spikes are generated as Poisson processes with rates given by the variable x (the state keyword is optional:
default = first variable defined). Note that x can change over time (inhomogeneous Poisson processes). The units of
variable x must be Hertz.
4.3 Connections
4.3.1 Building connections
First, one must define which neuron groups are connected and which state variable receives the spikes. The following
instruction:
myconnection=Connection(group1,group2,'ge')
defines a connection from group group1 to group2, acting on variable ge. When neurons from group group1
spike, the variable ge of the target neurons in group group2 are incremented. When the connection object is initialised, the list of connections is empty. It can be created in several ways. First, explicitly:
myconnection[2,5]=3*nS
This instruction connects neuron 2 from group1 to neuron 5 from group2 with synaptic weight 3 nS. Units should
match the units of the variable defined at initialisation time (ge).
The matrix of synaptic weights can be defined directly with the method Connection.connect():
W=rand(len(group1),len(group2))*nS
myconnection.connect(group1,group2,W)
Here a matrix with random elements is used to define the synaptic weights from group1 to group2. It is possible
to build the matrix by block by using subgroups, e.g.:
W=rand(20,30)*nS
myconnection.connect(group1[0:20],group2[10:40],W=W)
There are several handy functions available to set the synaptic weights: connect_full(), connect_random()
and connect_one_to_one(). The first one is used to set uniform weights for all pairs of neurons in the
(sub)groups:
myconnection.connect_full(group1[0:20],group2[10:40],weight=5*nS)
The second one is used to set uniform weights for random pairs of neurons in the (sub)groups:
myconnection.connect_random(group1[0:20],group2[10:40],sparseness=0.02,weight=5*nS)
Here the third argument (0.02) is the probability that a synaptic connection exists between two neurons. The number
of presynaptic neurons can be made constant by setting the keyword fixed=True (probability * number of neurons
in group1). Finally, the method connect_one_to_one() connects neuron i from the first group to neuron i
from the second group:
196
Chapter 4. User manual