Dear friends,
Thanks to all your help, I've successfully reproduced the behavior of the modified Izhikevich neuron described in the paper:
Chen, L., Campbell, S.A. Exact mean-field models for spiking neural networks with adaptation. J Comput Neurosci 50, 445–469 (2022). https://doi.org/10.1007/s10827-022-00825-9
But when I try to connect a population of neurons among themselves, I have problems. In particular, imagine I create 10 neurons with the following Python code: neurons = nest.Create("izhikevich_ODE", 10)
Then, I found in some of the examples that the neurons do not come connected, and to connect them all-to-all, I had to do the following: nest.Connect(neurons, neurons, 'all_to_all') Is that right?
Then, in the NESTML model, how do I receive the spikes into the gating variable? If I am not wrong, I have to set the input as input: spikes real <- spike and then add them to the synaptic gating variable as a simple convolution: kernel G = delta(t) SS' = ((-SS/tau) + S_jump/N * convolve(G, spikes)) /s Note: the /s is because the equations in the paper are without units. Is this right? As kernel, I also tried exp(-t/tau), with the same tau as the one used for SS, but then it seemed to take forever to compute, so I left the delta... However, if the spikes themselves are Dirac deltas, I do not completely understand the meaning of this convolution... What is the correct way to get the spikes from the other neurons?
thanks!
gus.-
Hi Gustavo,
Great to hear about your reports.
Actually, all_to_all should be the default connection rule, and seems to work OK for me:
pop = nest.Create("izhikevich", 10) nest.Connect(pop, pop) syn = nest.GetConnections(target=pop) len(syn)
100
For the postsynaptic integration, we are actually just in the process of fixing a confusion about the units of a train of delta pulses, please see here for a discussion: https://github.com/nest/nestml/pull/882#issuecomment-1517816133
Until that pull request is merged, please use the examples in the NESTML models database (at https://github.com/nest/nestml/tree/master/models/neurons) for guidance. For example, check out the _delta, _exp or _alpha neuron models. In principle, your kernel (exp(-t/tau)) should work fine. For a delta kernel, indeed you don't have to convolve the delta with a delta, but you can add the name of the spiking input port directly into the ODE for V_m. If you run into any trouble, feel free to send us your .nestml model file and .py test script, and we will try to reproduce the issue you are seeing.
With kind regards, Charl
On Mon, Apr 24, 2023, at 00:02, gustavo.patow@udg.edu wrote:
Dear friends,
Thanks to all your help, I've successfully reproduced the behavior of the modified Izhikevich neuron described in the paper:
Chen, L., Campbell, S.A. Exact mean-field models for spiking neural networks with adaptation. J Comput Neurosci 50, 445–469 (2022). https://doi.org/10.1007/s10827-022-00825-9
But when I try to connect a population of neurons among themselves, I have problems. In particular, imagine I create 10 neurons with the following Python code: neurons = nest.Create("izhikevich_ODE", 10)
Then, I found in some of the examples that the neurons do not come connected, and to connect them all-to-all, I had to do the following: nest.Connect(neurons, neurons, 'all_to_all') Is that right?
Then, in the NESTML model, how do I receive the spikes into the gating variable? If I am not wrong, I have to set the input as input: spikes real <- spike and then add them to the synaptic gating variable as a simple convolution: kernel G = delta(t) SS' = ((-SS/tau) + S_jump/N * convolve(G, spikes)) /s Note: the /s is because the equations in the paper are without units. Is this right? As kernel, I also tried exp(-t/tau), with the same tau as the one used for SS, but then it seemed to take forever to compute, so I left the delta... However, if the spikes themselves are Dirac deltas, I do not completely understand the meaning of this convolution... What is the correct way to get the spikes from the other neurons?
thanks!
gus.- _______________________________________________ NEST Users mailing list -- users@nest-simulator.org To unsubscribe send an email to users-leave@nest-simulator.org
Dear Gustavo,
You are right, the nest.Create() call only creates network nodes such as neurons or devices, but never connects them. This is done by a subsequent nest.Connect() call. The rule "all_to_all" can be omitted but only because it is the default rule, as shown in Charl's example below.
For an overview of connection rules like "all_to_all" and further constraints such as autapses or multapses, I can refer you to our recent publication: Senk et al. (2022) Connectivity concepts in neuronal network modeling. PLoS Comput Biol 18(9): e1010086. https://doi.org/ 10.1371/journal.pcbi.1010086
Best, Johanna
On 25.04.23 21:19, Charl Linssen wrote:
Hi Gustavo,
Great to hear about your reports.
Actually, all_to_all should be the default connection rule, and seems to work OK for me:
pop = nest.Create("izhikevich", 10) nest.Connect(pop, pop) syn = nest.GetConnections(target=pop) len(syn)
100
For the postsynaptic integration, we are actually just in the process of fixing a confusion about the units of a train of delta pulses, please see here for a discussion: https://github.com/nest/nestml/pull/882#issuecomment-1517816133
Until that pull request is merged, please use the examples in the NESTML models database (at https://github.com/nest/nestml/tree/master/models/neurons) for guidance. For example, check out the _delta, _exp or _alpha neuron models. In principle, your kernel (exp(-t/tau)) should work fine. For a delta kernel, indeed you don't have to convolve the delta with a delta, but you can add the name of the spiking input port directly into the ODE for V_m. If you run into any trouble, feel free to send us your .nestml model file and .py test script, and we will try to reproduce the issue you are seeing.
With kind regards, Charl
On Mon, Apr 24, 2023, at 00:02, gustavo.patow@udg.edu wrote:
Dear friends,
Thanks to all your help, I've successfully reproduced the behavior
of the modified Izhikevich neuron described in the paper:
Chen, L., Campbell, S.A. Exact mean-field models for spiking neural networks with adaptation. J Comput Neurosci 50, 445–469 (2022). https://doi.org/10.1007/s10827-022-00825-9
But when I try to connect a population of neurons among themselves, I have problems. In particular, imagine I create 10 neurons with the following Python code: neurons = nest.Create("izhikevich_ODE", 10)
Then, I found in some of the examples that the neurons do not come connected, and to connect them all-to-all, I had to do the following: nest.Connect(neurons, neurons, 'all_to_all') Is that right?
Then, in the NESTML model, how do I receive the spikes into the gating variable? If I am not wrong, I have to set the input as input: spikes real <- spike and then add them to the synaptic gating variable as a simple convolution: kernel G = delta(t) SS' = ((-SS/tau) + S_jump/N * convolve(G, spikes)) /s Note: the /s is because the equations in the paper are without units. Is this right? As kernel, I also tried exp(-t/tau), with the same tau as the one used for SS, but then it seemed to take forever to compute, so I left the delta... However, if the spikes themselves are Dirac deltas, I do not completely understand the meaning of this convolution... What is the correct way to get the spikes from the other neurons?
thanks!
gus.- _______________________________________________ NEST Users mailing list -- users@nest-simulator.org To unsubscribe send an email to users-leave@nest-simulator.org
NEST Users mailing list -- users@nest-simulator.org To unsubscribe send an email to users-leave@nest-simulator.org
Thanks, Johanna, this solves all my doubts! And thanks for pointing me at that paper! THANK YOU!!! Gus.-
Dear Charl, Thank you VERY much for your offer, and I think I will use it: I've spent a couple more days revisiting my model and the examples from NESTML, and cannot find what I am doing wrong. In particular, I have reduced my model to TWO neurons, but I cannot match the results in the original code. Note: My results are spike-perfect for a single neuron, so I am pretty sure my problem is related to the spikes, either at the .py or at the NESTML levels. Any help would be greatly appreciated.
Here is a link to my code:
https://www.dropbox.com/sh/mle8kes8lwyf48t/AABI_UUjB7YRlpVArMSUB6Sca?dl=0
And here is a link to the repository with the original Matlab code. Note: In my own folder, I have put a few plots of the expected results, taken from Matlab, so you do not need to execute anything.
https://senselab.med.yale.edu/ModelDB/ShowModel?model=267382#tabs-1
THANKS!!!! gus.-
Dear all, I've continued fiddling with the model, and I think I am misunderstanding the way I plug the spikes into the model. What I need is to add to the synaptic gating variable the spikes as a simple count of the number of firing neurons. That is
sum(1 if neuron fired)
where the sum runs over all neurons, or at least all neurons that fired. Basically, this is the same as asking the NUMBER of neurons that fired. Is convolve(delta(t), spikes) the way to achieve it? thanks!!! gus.-
Sorry to annoy you, but any hint on how to add to the synaptic gating variable the spikes as a simple count of the number of firing neurons? As I said above, what I need is to add sum(1 if neuron fired) to the gating var... Thanks! gus.-
Hi Gustavo,
If you have a spiking input port in the NESTML model, you could add the spikes directly to the equation for the gating variable since the spikes at any timestep would be the sum of all the spikes occurring at that time.
equations: gating_var' = …. + spikes
input: spikes pA <- spike
You could also use convolution if you want a post-synaptic response, for example, with a delta kernel as you mentioned in your previous email.
equations: gating_var' = …. + convolve(delta(t), spikes)
input: spikes pA <- spike
Hope this helps!
Thanks, Pooja
On 4. May 2023, at 20:45, gustavo.patow@udg.edu wrote:
Sorry to annoy you, but any hint on how to add to the synaptic gating variable the spikes as a simple count of the number of firing neurons? As I said above, what I need is to add sum(1 if neuron fired) to the gating var... Thanks! gus.- _______________________________________________ NEST Users mailing list -- users@nest-simulator.org To unsubscribe send an email to users-leave@nest-simulator.org
Dear Pooka,
Well, I tried this before, and I got a compilation error. Basically, I wrote:
SS' = (-SS/tau + S_jump/N * spikes) /s #remove the units (seconds)
input: spikes real <- spike
Then, I got the error with message:
/tmp/nestml-component/izhikevich_ODE.cpp:315:124: error: ‘SPIKES’ was not declared in this scope 315 | f[State_::SS] = (-0.001) * ode_state[State_::SS] / node.P_.tau + 0.001 * node.P_.S_jump * node.B_.spike_inputs_grid_sum_[SPIKES - MIN_SPIKE_RECEPTOR] / node.P_.N; | ^~~~~~ /tmp/nestml-component/izhikevich_ODE.cpp:315:133: error: ‘MIN_SPIKE_RECEPTOR’ was not declared in this scope 315 | f[State_::SS] = (-0.001) * ode_state[State_::SS] / node.P_.tau + 0.001 * node.P_.S_jump * node.B_.spike_inputs_grid_sum_[SPIKES - MIN_SPIKE_RECEPTOR] / node.P_.N; | ^~~~~~~~~~~~~~~~~~
Any ideas?
THANKS!!!
gus.-
Hi Gustavo,
It is a bit hard to understand the error with just these logs. Would you be able to share the .nestml file and a zip of the generated code (target directory) so that it is easier to analyse the error?
Thanks, Pooja
On 5. May 2023, at 22:20, Gustavo Patow gustavo.patow@udg.edu wrote:
Dear Pooka,
Well, I tried this before, and I got a compilation error. Basically, I wrote:
SS' = (-SS/tau + S_jump/N * spikes) /s #remove the units (seconds)
input: spikes real <- spike
Then, I got the error with message:
/tmp/nestml-component/izhikevich_ODE.cpp:315:124: error: ‘SPIKES’ was not declared in this scope 315 | f[State_::SS] = (-0.001) * ode_state[State_::SS] / node.P_.tau + 0.001 * node.P_.S_jump * node.B_.spike_inputs_grid_sum_[SPIKES - MIN_SPIKE_RECEPTOR] / node.P_.N; | ^~~~~~ /tmp/nestml-component/izhikevich_ODE.cpp:315:133: error: ‘MIN_SPIKE_RECEPTOR’ was not declared in this scope 315 | f[State_::SS] = (-0.001) * ode_state[State_::SS] / node.P_.tau + 0.001 * node.P_.S_jump * node.B_.spike_inputs_grid_sum_[SPIKES - MIN_SPIKE_RECEPTOR] / node.P_.N; | ^~~~~~~~~~~~~~~~~~
Any ideas?
THANKS!!!
gus.-
NEST Users mailing list -- users@nest-simulator.org To unsubscribe send an email to users-leave@nest-simulator.org
Dear Pooja,
The nestml file is this one (direct link):
https://www.dropbox.com/s/esj5ngyjkui0024/izhikevich_ODE.nestml?dl=0
And the contents of /tmp/nestml-component/ is in the following zip file:
https://www.dropbox.com/s/u10ivrs6y3v1pyr/nestml-component.zip?dl=0
I am sorry of this is not what you asked for, as I said, I am too newbie in nest/nestml...
best
gus.-
Hi Gustavo,
Thank you for sharing the code.
I looked at the generated code and found that there is indeed a bug in NESTML for this particular case where the equation has a numeric solver and refers to a spiking input port. I have created an issue for this: https://github.com/nest/nestml/issues/900
While we fix this issue, could I ask you to make a small change in the generated code? In the file izhikevich_ODE.cpp, please replace the line 315 with the below code:
f[State_::SS] = (-0.001) * ode_state[State_::SS] / node.P_.tau + 0.001 * node.P_.S_jump * node.B_.spike_inputs_grid_sum_[izhikevich_ODE::SPIKES - izhikevich_ODE::MIN_SPIKE_RECEPTOR] / node.P_.N;
After this, compile the code by going into the target directory and running make and make install.
Please note that it would take some time for us to fix this and apologize for the inconvenience.
I hope this fix helps!
Thanks, Pooja
On 7. May 2023, at 20:01, Gustavo Patow gustavo.patow@udg.edu wrote:
Dear Pooja,
The nestml file is this one (direct link):
https://www.dropbox.com/s/esj5ngyjkui0024/izhikevich_ODE.nestml?dl=0
And the contents of /tmp/nestml-component/ is in the following zip file:
https://www.dropbox.com/s/u10ivrs6y3v1pyr/nestml-component.zip?dl=0
I am sorry of this is not what you asked for, as I said, I am too newbie in nest/nestml...
best
gus.-
-- Prof. Dr. Gustavo A. PATOW ViRVIG-UdG and CNS-UPF Edifici P-IV, Campus Montilivi, Universitat de Girona, 17003 Girona, SPAIN
NEST Users mailing list -- users@nest-simulator.org To unsubscribe send an email to users-leave@nest-simulator.org
Hi,
Thanks Gustavo for writing in about the problem, and Pooja for triaging.
A fix has already been implemented and merged (https://github.com/nest/nestml/pull/901). Gustovo, could we ask you to try to run your code again with the latest master branch version of NESTML? Please let us know if you run into any trouble with installation or during runtime.
Yours, Charl
On Sun, May 7, 2023, at 21:54, Babu, Pooja wrote:
Hi Gustavo,
Thank you for sharing the code.
I looked at the generated code and found that there is indeed a bug in NESTML for this particular case where the equation has a numeric solver and refers to a spiking input port. I have created an issue for this: https://github.com/nest/nestml/issues/900
While we fix this issue, could I ask you to make a small change in the generated code? In the file izhikevich_ODE.cpp, please replace the line 315 with the below code:
f[State_::SS] = (-0.001) * ode_state[State_::SS] / node.P_.tau + 0.001 * node.P_.S_jump * node.B_.spike_inputs_grid_sum_[izhikevich_ODE::SPIKES - izhikevich_ODE::MIN_SPIKE_RECEPTOR] / node.P_.N;
After this, compile the code by going into the target directory and running make and make install.
Please note that it would take some time for us to fix this and apologize for the inconvenience.
I hope this fix helps!
Thanks, Pooja
On 7. May 2023, at 20:01, Gustavo Patow gustavo.patow@udg.edu wrote:
Dear Pooja,
The nestml file is this one (direct link):
https://www.dropbox.com/s/esj5ngyjkui0024/izhikevich_ODE.nestml?dl=0
And the contents of /tmp/nestml-component/ is in the following zip file:
https://www.dropbox.com/s/u10ivrs6y3v1pyr/nestml-component.zip?dl=0
I am sorry of this is not what you asked for, as I said, I am too newbie in nest/nestml...
best
gus.-
-- Prof. Dr. Gustavo A. PATOW ViRVIG-UdG and CNS-UPF Edifici P-IV, Campus Montilivi, Universitat de Girona, 17003 Girona, SPAIN
NEST Users mailing list -- users@nest-simulator.org To unsubscribe send an email to users-leave@nest-simulator.org
NEST Users mailing list -- users@nest-simulator.org To unsubscribe send an email to users-leave@nest-simulator.org
*Attachments:* • smime.p7s
Dear Charl,
This may sound as a very silly question, but I am using docker to run my notebooks... is this version already in the docker distribution? If not, I am afraid I will have to wait, as direct installation gave me too many problems on my Mac... sorry!
cheers
gus.-
Hi Gustavo
the latest development version of the Docker image is available now.
Please pull it from our new dockerhub repository:
docker pull nest/nest-simulator:dev
Hope this helps.
Best
Steffen
Am 09.05.23 um 20:04 schrieb Gustavo Patow:
Dear Charl,
This may sound as a very silly question, but I am using docker to run my notebooks... is this version already in the docker distribution? If not, I am afraid I will have to wait, as direct installation gave me too many problems on my Mac... sorry!
cheers
gus.-