Using custom synaptic weight matrix

Hi @pshah95 . Unfortunately we only mention the other direction (getting a weight matrix out of Brian’s internal structure) in the documentation, but if you have a fully-connected network, then using a weight matrix to set the weights is actually quite simple. After connecting things you can use:

Ce.w[:] = W.flatten()*mV

This works because the internal ordering of synapses is exactly the same as for a flattened matrix.

Hope that helps, best
Marcel

PS: It is doing exactly the same thing, but the more “canonical” way of asking for an all-to-all connectivity would be Ce.connect(True) or Ce.connect() instead of Ce.connet(p=1.0).

1 Like