You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just adapted the test_synapses_to_synapses.py test to find out if I need to take care of some form of subgroups when the targat of a SynapticPathway is a Synapses object. Here is the adapted test:
frombrian2import*set_device('cpp_standalone')
source=SpikeGeneratorGroup(3, [0, 1, 2], [0, 0, 0]*ms, period=2*ms)
modulator=SpikeGeneratorGroup(3, [0, 2], [1, 3]*ms)
target=NeuronGroup(3, 'v : integer')
conn=Synapses(source, target, 'w : integer', on_pre='v += w')
conn.connect(j='i')
conn.w=1# XXX: I added the `['i > 0']` indexmodulatory_conn=Synapses(modulator, conn['i > 0'], on_pre='w += 1')
modulatory_conn.connect(j='i')
run(5*ms)
# First group has its weight increased to 2 after the first spike# Third group has its weight increased to 2 after the second spikeassert_array_equal(target.v, [5, 3, 4])
This fails with
KeyError: 'No template with name "group_get_indices" found.'
All I did compared to the original test is adding a ['i > 0'] index to the target Synapses object in the modulatory synapse:
Should this be possible at all? Creating a Synapses subgroup by string indexing? It seems like this could be implemented (something like a simple version of the synapses_create_generator template that checks the condition for each created synapse). But I don't think it is, right? If not, this should probably raise a better error message?
While here with this test: Is there any other way that modulatory_conn could target a subgroup of conn in the line above. Or in other words, is it possible to create a subgroup of a Synapses object before running the network in standalone mode? If not, this would make the brian2cuda implementation much easier.
And to make sure I didn't miss anything: SynapsesPahtway objects have to have a spiking NeuronGroup as their source and having Synapses as source of a SynapticPathway object is not possible since Synapses can't define spikes / events on which the pathway is activated. Correct?
The text was updated successfully, but these errors were encountered:
Hi there!
I just adapted the test_synapses_to_synapses.py test to find out if I need to take care of some form of subgroups when the targat of a
SynapticPathway
is aSynapses
object. Here is the adapted test:This fails with
All I did compared to the original test is adding a
['i > 0']
index to the targetSynapses
object in the modulatory synapse:Synapses
subgroup by string indexing? It seems like this could be implemented (something like a simple version of thesynapses_create_generator
template that checks the condition for each created synapse). But I don't think it is, right? If not, this should probably raise a better error message?modulatory_conn
could target a subgroup ofconn
in the line above. Or in other words, is it possible to create a subgroup of a Synapses object before running the network in standalone mode? If not, this would make the brian2cuda implementation much easier.SynapsesPahtway
objects have to have a spikingNeuronGroup
as theirsource
and havingSynapses
assource
of aSynapticPathway
object is not possible sinceSynapses
can't define spikes / events on which the pathway is activated. Correct?The text was updated successfully, but these errors were encountered: