Hello, I need to implement custom synaptic weight matrices into my network. I have found a way of doing this using a for loop that goes through all the source and target neurons in the network and sets the synaptic weight directly for each synapse. However, the loop takes a very long time to complete for a 10^3 network size. Is there a faster or more correct way of setting custom synaptic weight matrix throughout the network? Is there a direct method to specify a custom synaptic weight matrix in the Synapses group?
N = 4000 # number of neurons in network eqs = """ dv/dt = (ge+gi-(v-El))/taum : volt (unless refractory) dge/dt = -ge/taue : volt dgi/dt = -gi/taui : volt """ P = NeuronGroup(N, eqs, threshold='v>Vt', reset='v = Vr', refractory=5*ms, method='exact') W = mtx # N x N custom connectivity matrix Ce = Synapses(P, P, 'w_e: volt', on_pre='ge += w_e') Ce.connect(p=1.0) for i in range(N): for j in range(N): msg = 'connecting neurons %s and %s' % (i, j) print(msg, end='\r') Ce.w_e[i, j] = W[i,j]*mV
Thank you for any advice you might have.