If you plot the
tanh function, you’ll notice that the slope of the curve at the midpoint is roughly 45 degrees. The
gain parameter here changes this slope, and having a bigger gain value increases the “steepness” of this slope. You can experiment with it yourself by changing the
gain in the code to see what effect it has.
That is essentially correct. In Nengo, if you do not specify any defaults, the neurons will start with a blank state (i.e., 0 input current, 0 membrane current, etc.). This means that when the simulation starts, the neurons aren’t doing anything (and outputs no spikes), and it takes a few timesteps for the neuron to get going. We refer to these as “startup transients”.
The mapping would be similar in the spiking version, with the addition that the “output value” is scaled by the firing rate. As an example, if you had a “conventional”
tanh function (i.e., the
gain=1), an input value of 1 would have an output value of 0.77. In the spiking version, the output would be this value multiplied by the maximum firing rate. In @Eric’s example code, the maximum firing rate of the
tanh neuron is 400Hz, so the output of such a neuron with an input of 1, would be $400 \times 0.77 \approx 308$.
If you change the
gain in the code to
1, and run Eric’s code, you will see a graph like this:
And it indeed shows that when the input to the neuron is 1 (i.e., at
t=2s), the output firing rate is about 300.