You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose to handle convolutions by means of a transformer. For each convolve() call, one or more new state variables will be generated (as is currently also the case with the __X__ syntax). A new event handler (onReceive block) will be generated that increments the new state variables when a spike arrives. The priority of the handler will be clearly defined to be the highest of all (or the lowest of all) event handlers, so that the rest of the code (update block and other event handlers) get a consistent "just before" or "just after" value.
This would also hold for delta kernels. When using a delta kernel, we do not need a new state variable, but should just increment $V_m$ directly; however, this turns out to be very difficult to implement (what if, for instance, the convolve() call appears inside of a complex mathematical expression?), so there would be some overhead in terms of an extra, in principle potentially unnecessary state variable—but at least the behaviour would be consistent.
N.B.: this means there will probably be two passes through ODE-toolbox: first, the kernel equations are given to ODE-toolbox (as a function of time, first, or higher-order ODE), and returned as a set of first-order ODEs, which are added into the model. During code generation, the system of equations (including the new ODEs that derive from the kernels) are passed to ODE-toolbox again.
I propose to handle convolutions by means of a transformer. For each convolve() call, one or more new state variables will be generated (as is currently also the case with the
__X__
syntax). A new event handler (onReceive
block) will be generated that increments the new state variables when a spike arrives. The priority of the handler will be clearly defined to be the highest of all (or the lowest of all) event handlers, so that the rest of the code (update
block and other event handlers) get a consistent "just before" or "just after" value.For instance,
would be transformed into
This would also hold for delta kernels. When using a delta kernel, we do not need a new state variable, but should just increment$V_m$ directly; however, this turns out to be very difficult to implement (what if, for instance, the convolve() call appears inside of a complex mathematical expression?), so there would be some overhead in terms of an extra, in principle potentially unnecessary state variable—but at least the behaviour would be consistent.
Fixes #993 and #1013.
The text was updated successfully, but these errors were encountered: