Download Example - Read the Docs

Transcript
Brian Documentation, Release 1.4.1
myconnection.connect_one_to_one(group1,group2,weight=3*nS)
Both groups must have the same number of neurons.
If you are connecting the whole groups, you can omit the first two arguments, e.g.:
myconnection.connect_full(weight=5*nS)
connects group1 to group2 with weights 5 nS.
Building connections with connectivity functions
There is a simple and efficient way to build heterogeneous connections, by passing functions instead of constants to
the methods connect_full() and connect_random(). The function must return the synaptic weight for a
given pair of neuron (i,j). For example:
myconnection.connect_full(group1,group2,weight=lambda i,j:(1+cos(i-j))*2*nS)
where i (j) indexes neurons in group1 (group2). This is the same as doing by hand:
for i in range(len(group1)):
for j in range(len(group2)):
myconnection[i,j]=(1+cos(i-j))*2*nS
but it is much faster because the construction is vectorised, i.e., the function is called for every i with j being the entire
row of target indexes. Thus, the implementation is closer to:
for i in range(len(group1)):
myconnection[i,j]=(1+cos(i-arange(len(group2)))*2*nS
The method connect_random() also accepts functional arguments for the weights and connection probability.
For that method, it is possible to pass a function with no argument, as in the following example:
myconnection.connect_random(group1,group2,0.1,weight=lambda:rand()*nS)
Here each synaptic weight is random (between 0 and 1 nS). Alternatively, the connection probability can also be a
function, e.g.:
myconnection.connect_random(group1,group2,0.1,weight=1*nS,sparseness=lambda i,j:exp(-abs(i-j)*.1))
The weight or the connection probability may both be functions (with 0 or 2 arguments).
4.3.2 Delays
Transmission delays can be introduced with the keyword delay, passed at initialisation time. There are two types of
delays, homogeneous (all synapses have the same delay) and heterogeneous (all synapses can have different delays).
The former is more computationally efficient than the latter. An example of homogeneous delays:
myconnection=Connection(group1,group2,'ge',delay=3*ms)
If you have limited heterogeneity, you can use several Connection objects, e.g.:
myconnection_fast=Connection(group1,group2,'ge',delay=1*ms)
myconnection_slow=Connection(group1,group2,'ge',delay=5*ms)
For a highly heterogeneous set of delays, initialise the connection with delay=True, set a maximum delay with for example max_delay=5*ms and then use the delay keyword in the connect_random() and
connect_full() methods:
4.3. Connections
197