Hi Ejved,
> The first one is the freeze argument for NeuronGroup. As I understand
> there is no more such argument in Brian2. I found some mentions about
> it only for the PoissonInput object. Could you please advice if I can
> just delete this argument and forget about it or I should find any
> workaround?
The freeze argument in NeuronGroup was just an optimisation option (it
replaced constants with their values), you can simply delete it. It was
a bit confusing in Brian 1, the freeze argument in PoissonInput actually
had a completely different meaning...
> The second problem is the usage of matrices in delays for Synapses. In
> the model I work on the delays are given this way: delay = lambda i,j:
> A[i,j]*a*ms; where A is some matrix and a is some parameter. I changed
> it to S.delay[i,j]='A[i,j]*a*ms', but it seems that [] brackets are
> not accepted by Brian2 here. I is quite hard to turn the logic that
> lies under the matrix into a math expression, so I would like to ask
> if there any other ways to keep using the matrix for delay.
In Brian 2, connections and synaptic variable are always tored in
1-dimensional arrays which has the big advantage that we can use the
same data structure for all kind of connection patterns (full, dense,
sparse, ...). String expressions can indeed not index into arrays, but
you could loop over the connections and do "S.delay[i, j] = A[i,
j]*a*ms" (i.e., without a string on the right-hand side) for every
synapse. This is quite inefficient for large arrays, though. It is
better to do a single assignment, but for this your right-hand side has
to be a 1-dimensional array that contains entries in the same order as
our Synapses data structure. Luckily, this is not very difficult:
If you have a full connection matrix (i.e. you used S.connect() or
S.connect(True)) and A stores the values with the source index as the
first, and the target index as the second dimension you can simply
flatten it:
S.delay[:] = A.flatten()*a*ms
If your network is not fully connected, you can use the source and
target indices stored in the synapses object to get the relevant values
out of your matrix:
S.delay[:] = A[S.i[:], S.j[:]]*a*ms
Best,
Marcel