Exploring STDP parameters through one network

Hi @sblain . I don’t have time to look into this in detail before next week (I think there is a more efficient way to implement things), but here’s a first hint. The problem in your code seems to be that each of your different Synapses objects refers to the variables Apre and Apost, but by default Brian resolves references to external variables only once, at the end of your script when you call run (see Namespaces — Brian 2 2.5.0.3 documentation). This means that all of the synapses will use the same value (the final values you set in the loop). You can work around this, by adding a namespaces dictionary to the respective Synapses objects, i.e. Synapses(G_PRE, G_POST, ..., namespace={'Apre': Apre_to_explore[ind_boucle], ...). In that case, you will have to mention all the external variables the Synapses object references in its namespace argument, though. I.e. not only Apre and Apost, but also taupre, taupost, and wmax.

Hope that helps, best
Marcel

1 Like