I thought I could view/change variables of a synaptic subgroup as is possible for a neuron Subgroup, but I cannot. I don’t see this mentioned in the docs anywhere.
I can work around this, but I just thought I’d share something that was counterintuitive to me, as well as ask a quick question:
From what I understand, it’s more efficient to have a single NeuronGroup when different types share equations, then use SubGroups for each. Does the same go for Synapses? Should I use a single Synapses object when possible between two neuron groups, rather than different Synapses objects between each pair of subgroups?
Hi @kjohnsen I agree that this is confusing. The SynapticSubgroup is currently of very limited use, it is only a placeholder for indices. E.g. you could monitor all weights targetting neuron 1 by using StateMonitor(syn, 'w', record=syn[:, 1]).
The good news is that I have been working on fixing this as part of a major overhaul of the indexing system (https://github.com/brian-team/brian2/pull/1229) – it is still not quite ready to be merged, but I am getting there. As you saw, using syn.w[...] instead of syn[...].w is currently the way to go – after merging the PR, both would work in the same way.
Yes, in general this is preferable. It is mostly affecting compilation times, though (due to many additional near-identical source code files that need to be compiled); the simulation time shouldn’t change much for reasonably large networks.