Nengolib Incompatability

In addition to @arvoelke’s suggestion, I have managed to figure out a workaround to get the notebook to work with very minimal changes. This would be useful to have some sort of starting point to convert the notebook to a fully native Nengo version.

Instructions:

  1. Clone and checkout the nengo3 branch of nengolib. This branch addresses the import statements that broke in nengolib when Nengo was update to v3:
git clone -b nengo3 https://github.com/arvoelke/nengolib
  1. Clone and checkout the nengolib-linearsystem branch of Nengo. This branch ports over most of the linear system stuff (synapses and filters, etc.) from nengolib into Nengo. As @arvoelke noted, this is just to get the bandpass synapse to work.
git clone -b nengolib-linearsystem https://github.com/nengo/nengo
  1. Create a Conda environment, then pip install the branched versions of nengolib and nengo:
cd <git_root>
pip install -e nengolib
pip install -e nengo
  1. Install the rest of the packages needed:
pip install jupyter matplotlib seaborn

To get the code to work, you’ll need to modify the notebook as well. I noticed that with the default learning rate (0.1) the system was super unstable. I dropped it down to 0.00001 and it seemed to do better. You can probably play around with the learning rate to tune the performance. I haven’t tried the built-in Nengo RLS rule myself, so you might have to tweak the learning rate for that too. One thing to note is that NengoFPGA only supports the PES learning rule, so you’ll need a way to reframe or reimplement the RLS rule as a PES learning rule (if that is at all possible).

Another thing you’ll need to modify in the notebook is to use the built-in Nengo bandpass synapse. To do this change this line:

nengo.Connection(u, z, synapse=nengolib.synapses.Bandpass(freq, decay))

to this:

nengo.Connection(u, z, synapse=nengo.synapses.Bandpass(freq, 1.0 / decay))

You’ll notice that the second function argument is different. If I am interpreting the documentation correctly, the nengolib bandpass synapse uses Q as the second function argument, whereas the Nengo bandpass synapse uses alpha as the second function argument. From the docs here, it states that alpha is the inverse of Q, thus the reciprocal.