I am looking at how this function is used inside the dl_converter here since this is where I will need to insert my modified Convolution class.
After looking through the code, I don’t really see where the actual convolution is done or how it is actually specified in the code. From what I can tell, the nengo.transforms.Convolution class only modifies the kernel shape information and specifies an output size. Can anyone give me any pointers on how I can understand what is going on and how I can modify it?
The Nengo code base is sort of divided into two parts: the interface, and the simulator. The code you linked to is part of Nengo’s interface, and it essentially defines the API that users can use to instantiate and configure Nengo objects within their Nengo models. The code that you’ll probably want to modify is the simulation code, and to do that, you’ll want to look at the builder functions. Builder functions take parameters defined by the user (and stored in the interface objects) and create the underlying Nengo objects (signals and operators) that are used by the Nengo simulator code to run the simulation.
The builder function sets up the Nengo signals that will be used by the simulator to store input, output and any intermediate values that is important to the simulation. As an example, the convolution operation requires a signal for the weights, the input value, and the output value. If your modified convolution class requires storing any additional information, you’ll need to modify this function. Otherwise, it can mostly be left the same.
The operator class contains all of the logic that the Nengo simulator runs whenever it encounters the associated object (e.g., the nengo.transforms.Convolution object) in the Nengo model. This is the code you’ll need to modify to change the behaviour of the convolution transform.
As a side note, NengoDL uses the same concept of interface code + builder code, and has it’s own builder code for the convolution transform. However, in the case of NengoDL, the builder code builds the Nengo model into native TensorFlow operators so that the Nengo code can be run in TensorFlow.