brian-team / brian2

Brian is a free, open source simulator for spiking neural networks.
http://briansimulator.org
Other
941 stars 221 forks source link

Allow more fine-grained scheduling control for object components #790

Open mstimberg opened 7 years ago

mstimberg commented 7 years ago

We allow flexible scheduling of individual objects (NeuronGroup, Synapses, etc.) via the dt, when, and clock arguments, but the user does not have more fine-grained control over the individual components of an object (e.g. the state update, the summed variable update, etc. for a Synapses object). Most of the time this is of course not necessary, but there are situations where this would be useful, see e.g. this post here: https://groups.google.com/d/msg/brian-development/HykUi9griX8/hHJezPvKDwAJ

thesamovar commented 7 years ago

Agreed. Actually one of my students ran into this, also when working on plasticity models. It is actually possible if you know the names of the updater, thresholder etc., so maybe it's enough to just document that more clearly?

mstimberg commented 7 years ago

It is possible and quite easy for some things like thresholds, but for other things it is more tricky (e.g. re-assigning the _clock attribute will actually change the execution to a different clock, but it will still use the dt of the old clock if it appears in equations!). It is not very complicated to improve, but we should carefully go through things to make sure it always works as expected -- and the most easy way is probably to have an explicit syntax for it at object construction. I guess something along the lines of allowing dt={'state_updater': 1*ms}.

thesamovar commented 7 years ago

Good point - and yeah a syntax along those lines sounds good to me!