Hi @vzanon, and welcome back to the Nengo forums!
Iām not entirely sure what you are asking in your first question. Are you asking if itās possible to inhibit the output of a neural ensemble based on some inhibitory signal? If that is your question, then yes, it is. The example you linked (here) demonstrates exactly how to do this.
Yes, it is the case that in that example, one of the ensembles (A
) is being inhibited by an āartificialā piecewise control signal. However, the other ensemble (B
) is being inhibited by the output of a spiking ensemble (C
). I think that this is what you are trying to ask? In Nengo, we rarely use single spikes to inhibit the output of ensembles (although, it is possible to do, Iāll expand a bit later). Rather, in Nengo, we use the decoded output of an ensemble (basically, a lot of spikes smoothed together) as the inhibitory control signals.
There are a few ways to do this. If the inhibition time is relatively short (within a few 100 milliseconds), you can just use a very long time constant on the synapse of the inhibitor connection. As an example, the following code
nengo.Connection(C, B.neurons, transform=[[-5]] * n_neurons, synapse=0.1)
will inhibit an ensemble for about 0.34s. If you want to stick with generally biologically realistic synaptic time constants, the maximum synaptic time constant is about 1-5s. You may also have to modify the inhibition weight (in the code above itās -5
) to get the results you want. I should also note that using large synaptic time constants can lead to the output of the inhibited ensemble being āslowā to respond (when the inhibition is removed).
Another method is to use a circuit to generate the inhibitory signal. In my PhD thesis (Figure 4.6 & 4.7 ā also see this forum post), I describe a fast decaying integrator circuit which I used to generate an inhibitory signal. You can modify the length of the inhibitory signal by adjusting the decay value on the feedback of the integrator. With this approach, you can get the inhibitory signal to stick around for tens to hundreds of seconds.