 Difference between synapse=None and synapse=0?

My understanding of the difference between setting the synapse=0 and synapse=None is that None applies no filter and no time delay, but 0 applies a time-delay of one-step. Is this correct? Where is this documented? I had to figure it out again by running this code:

import nengo
import numpy as np
import matplotlib.pyplot as plt

with nengo.Network() as model:
in_nd = nengo.Node(lambda t: np.sin(20*t))

a_ens = nengo.Ensemble(100, 1)

nengo.Connection(in_nd, a_ens, synapse=None)

none_synapse = nengo.Probe(a_ens, synapse=None)
normal_synapse = nengo.Probe(a_ens, synapse=0.01)
zero_synapse = nengo.Probe(a_ens, synapse=0)

with nengo.Simulator(model) as sim:
sim.run(0.1)

plt.plot(sim.data[none_synapse], alpha=0.3)
plt.plot(sim.data[normal_synapse])
plt.plot(sim.data[zero_synapse], alpha=0.3)
plt.legend(["none", "normal", "zero"])
plt.show()


This gives the result:

2 Likes

Yes that is correct. AFAIK this is undocumented. Also, Nengo 2.0 used to have a two-step delay for each synapse (also undocumented).

Each synapse adds a one-step delay (see for e.g., by decreasing your normal_synapse to a very small number). On the other hand, specifying None is like having no synapse, and therefore no delay. This is also why you will encounter an error if you form a cycle that consists of None synapses.

As a subtle note, using a synapse that is not strictly proper (i.e., $D \ne 0$ in the state-space, for e.g., $H(s) = \frac{\tau s}{\tau s + 1}$) will introduce one additional delay, due to the way the synapses are currently implemented. This was revealed in #938, and then closed as the point is nuanced. These things should be documented.

2 Likes