You’ll need to write your own synapse model for this, since you’re defining a new type of synapse. However, Nengo is set up to make that relatively easy to do. You can take a look at some of the existing implementations to see how this works, e.g. the
Triangle synapse implementation here.
Basically you create a subclass of
nengo.synapses.Synapse, and implement the
make_step function. This is a function that creates the synaptic step function. That step function takes two things as input, the current simulation time and the current input value of the synapse on one timestep, and outputs the computed output value of the synapse for that simulation step. So you can write whatever logic you want in the middle there (and it can be dependent on the input value of the synapse, which is what you need). Then you just pass that process you made as the synapse parameter, like
nengo.Connection(B, C, synapse=MySynapse()).
If you want to use the output of multiple ensembles to compute the synaptic output, then I would concatenate them together using an intermediate node and then apply your synapse to that concatenated signal (so that inside the Synapse
step function you have access to the output of both ensembles in the synapse input signal). E.g.,
node = nengo.Node(size_in=A.size_out + B.size_out)
nengo.Connection(node, C, synapse=MySynapse())