Call custom function on Object at every timestep

Thanks for reporting the bug in net_diagram! We’re currently deciding what parts of Nengo Extras to maintain better and what parts to remove, so it’s great to know that you’ve been finding the graphviz module useful (despite the bugs). If we decide to keep it, we’ll be sure to fix it before the Nengo Extras release.

The input is the neural activity, not the weights. By “neural activity,” I am referring to the output of the neuron’s activation function, which is a function of its input current. In your network, the input current is determined by the inp node. The activation function depends on the neuron_type of the ensemble, which in your case is nengo.LIF.

The (100,) vector that you get inside the filter method is what each of the neuron is doing on that timestep (timestep t). Since you’re using the default LIF neuron type, and you’re not filtering the nengo.Connection from pre to you memristor nodes, the neural activity is always going to be either 0 or 1 / dt, where 0 is the output when the neuron doesn’t spike, and 1 / dt is the activity when it does spike. We use 1 / dt for spikes so that you can filter the neural activity of a spiking neuron to obtain an estimate of its firing rate.

In your network, there are no weights between the connection from pre.neurons to memristor_plus / memristor_minus. Well, more accurately the weights are an identity matrix. Changing the weights during the simulation would require implementing a learning rule type, but with the way things are set up, you can instead store and modify the weights inside Memristor, which is what it seems like you are doing.

For a more visual representation of what’s happening, you can see the NEF summary notebook. Cell [7] shows the neural activity of 8 neurons, over time. We draw lines for spikes, but you can imagine that inside the filter method, each of those lines corresponds to a filter call in which the value for that neuron is 1 / dt for that timestep. Cell [9] shows what happens if you add a lowpass filter to the neural activity; I presume that output of your filter method will be similar.