-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding attributes to spike events #946
Comments
As discussed in the NESTML meeting, the syntax for the
Each input port of the vector The input port cannot be used on its own without a vector index in an
|
(comment on Mathematical definition of input port above) I find it problematic to use the same quantity
and in
Mathematically, this is wrong. The units on the lhs and on the rhs must be identical. The idea that the
With this, we could write:
and
(to make it shorter, one could perhaps replace As far as I understand, the construct a) at a given point in time b) from a single presynaptic neuron. If multiple spikes from different presynaptic neurons arrive at the same time, each of these spikes "invokes" its own private |
Currently, neurons can emit spikes by calling the NESTML predefined function
emit_spike()
, without any arguments. Synapses can emit spikes by callingemit_spike(w, d)
, passing the weight and delay parameters.It would be great if we could unify these functions and make them more generic. Could we rewrite this in a way where there is a generic "event", to which we can attach attributes (like weight and delay, or multiplicity, or any named parameter at all)? Then we could do something like:
These attributes could subsequently be read out in an event handler as follows:
as opposed to the current implementation, where
exc_spikes
is defined as a sum of delta pulses (with physical units 1/s):In the new implementation, the event attribute "weight" would simply have the units of whatever we put in on the sending side, but we would need a way to explicitly specify the expected unit on the receiving side, which might look something like this:
Possibly, the attributes and types should also be specified as part of the output port:
One issue is that naming conventions might be different between the sending side and receiving side (for instance, "w" and "weight"). We could use the code generator options dictionary to make a mapping between these, as we are already doing for the port names currently. Each attribute that is needed on the receiving side should be mapped to attributes of the sender's spike event, but it should be allowed for a sender to attach all kinds of attributes to its output events that will be potentially unused.
In case there are no event attributes, the port name cannot be accessed inside the
onReceive
block, for instance:Vector input ports
Possibly related is the support for a vector of input ports. Constructs like
onReceive(exc_spikes[5])
should be allowed ifexc_spikes
is defined as a vector of suitable length.Consider the follow example, but where
exc_spikes
is a vector:Is it implied that
exc_spikes.weight
is also a vector?Named parameters
Instead of
we could name parameters in the style of Python:
For this feature, see #1122.
Types of convolutions
In case of a spiking input port without any attributes:
It should be allowed to write a convolution with that input port. For example:
Because$K$ can be a $\delta$ -function, it should also be possible to write:
or, in a variant that includes attributes:
Mathematical definition of input port
If there are no attributes, the spike input port variable
spike_in_port
is interpreted as a series of delta pulses:This has the physical unit [1/s].
If there are attributes, they are similarly defined; for instance, for the weight
If the
weight
is in pA, this has the physical unit [pA/s].Example for a convolution:
Example for an event handler
Here, it does it make sense to think of
spike_in_port.weight
as a function of time? We are evaluating it precisely at the instant of the event; say that in the onReceive block, the trains of delta pulses are implictly convolved with a delta kernel, which takes out the unit [1/s]:Then, on the left and right-hand side, we have something in units of [pA]. In pseudo-NESTML code:
However, what about the original example, where we could write:
In this case, we would have [V] on the left-hand side and [pA/s] / [A*s/V] = [V / s**2] on the right, which is clearly inconsistent. But perhaps the constant of proportionality ($C$ ) here is the wrong choice, and something in terms of charge should be formulated, as we are dealing with an instantaneous event.
Alternative
A predefined attribute
spike_in_port.times
could be defined, that would be the sum of delta pulses and have units [1/s], while the other attributes (such asspike_in_port.weights
) would be defined as [pA].Necessary documentation
Necessary cocos
emit_spike()
function call, check that types correspond to the ones defined in the output blockname.attribute
, ifname
is resolved to an input port name, check thatattribute
is amongst the attributes defined in the input port declarationupdate
block: would we be getting the value at the start of the block (t), at the end of the block (t+Δt) or somewhere inbetween?The text was updated successfully, but these errors were encountered: