Skip to content
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

Sender_id information available in the update block #1022

Open
rbonometto opened this issue Apr 12, 2024 · 4 comments
Open

Sender_id information available in the update block #1022

rbonometto opened this issue Apr 12, 2024 · 4 comments

Comments

@rbonometto
Copy link

Hello everyone, I am currently working on a SNN implementation of a closed-loop control system to simulate the role of cerebellum in motor control.
I am trying to develop in NESTML a model of a neuron to perform state estimation as explained in https://direct.mit.edu/neco/article/34/9/1893/112384/Bayesian-Integration-in-a-Spiking-Neural-System. To do so, I would need to use in the update block the information of which neuron has sent a specific spike (sender_id in NEST); however, I haven't found a way to do so. As a workaround, I tried to define a different port for each neuron through vectorized ports, to then establish one to one connections but the problem still persists as vectorized ports don't seem to support indexing through variables, neither in the definition in the state block:
fbk_spikes[N_fbk] <- spike
nor to access their content in the update block:
fbk_buffer[index] = fbk_spikes[i].
In this last case, the generated code in the cpp file is:
S_.fbk_buffer[index] = (0.001 * B_.spike_inputs_grid_sum_[FBK_SPIKES_0 - MIN_SPIKE_RECEPTOR]);}
whatever the value of i, which raises a 'make all' error.

@clinssen
Copy link
Contributor

Hi, thanks for writing in! I think defining vector input ports are the way to go here. @pnbabu: could you look into what the issue is with addressing using a variable? This should work and it might be just a small fix.

@pnbabu
Copy link
Contributor

pnbabu commented Apr 15, 2024

@rbonometto Hi, could you please share a simple reproducible version of your model so that I can see locally what's going wrong?

@rbonometto
Copy link
Author

@pnbabu sure! This is what I wrote so far: state_neuron.zip

@pnbabu
Copy link
Contributor

pnbabu commented Apr 25, 2024

@rbonometto The issue with vector input ports is fixed in this PR: #1042
Thank you for pointing it out! Could you please pull these changes and check if they work for you?

Note that with these changes, the vector input ports are indexed starting from 0. So please change your models accordingly. Please don't hesitate to reach out if you have further questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants