Hello everyone, As the title says, can someone help me answer this? I am really confused about this. Because I need to know how to control the neuron spiking from the mathematical formula, and I check out the iaf_psc_alpha.cpp and its .h file, and I can't get a clue how does the synapse weight value influence the neuron spiking. I would be appreciate if you can tell me how to check out the code in nest_simualator. Thank you. Enguang
Dear Enguang,
When a neuron receives a spike, its handle() method for SpikeEvents is invoked. Typically, this method just files the incoming spike into a temporary buffer. Some neuron models put spikes into different buffers depending on the sign of the weight: spikes with negative weight are interpreted as inhibitory, and positive weight as excitatory. For iaf_psc_alpha, this is done here:
https://github.com/nest/nest-simulator/blob/2869b6364ccd85edf69246deb12c03c0...
Note that the weight is read out by calling get_weight() on the spike event, and is stored in the buffer.
The actual numerical integration then happens in the update() method, which is called once every simulation timestep. Here, the spikes are read out again from the buffer, and their contribution added to synaptic current (and via there, membrane potential). For iaf_psc_alpha, this is at:
https://github.com/nest/nest-simulator/blob/2869b6364ccd85edf69246deb12c03c0...
The integration of excitatory spikes, for example, happens on lines 345-346.
Hope this helps, if anything's unclear please don't hesitate to get back in touch.
Best regards, Charl
On Tue, Dec 29, 2020, at 13:36, enguang zhou wrote:
Hello everyone, As the title says, can someone help me answer this? I am really confused about this. Because I need to know how to control the neuron spiking from the mathematical formula, and I check out the iaf_psc_alpha.cpp and its .h file, and I can't get a clue how does the synapse weight value influence the neuron spiking. I would be appreciate if you can tell me how to check out the code in nest_simualator. Thank you. Enguang _______________________________________________ NEST Users mailing list -- users@nest-simulator.org To unsubscribe send an email to users-leave@nest-simulator.org
Dear Charl, Thank for your answer. And I am also confused about the code on lines 345-346, at https://github.com/nest/nest-simulator/blob/2869b6364ccd85edf69246deb12c03c0.... The line 345 says 'V_.weighted_spikes_ex_ = B_.ex_spikes_.get_value( lag );', and does that means V_weighted_spikes_ex_ is the weight I set?
Except the last question, I also want to confirm whether I understand right to those code on lines 380-395(showed below), which is a handle invoked by spike event. First, the get_weight() will get the weight I set, multiplied by something(I don't know what it is, If you can answer that will be better ). Second the 's' variable will be stored in buffer by add_value() . Third when execute the code on 345 line(showed above) of update(), the get_value() will read out the 's' stored by add_value(). Fourth, does there a differential equation describing the membrane potential for the iaf_psc_alpha model? I know there are several neurons have differential equation such as gif_cond_exp neuron, this is at ,
https://nest-simulator.readthedocs.io/en/nest-2.20.1/models/neurons.html?hig...
iaf_psc_alpha::handle( SpikeEvent& e ) { assert( e.get_delay_steps() > 0 );
const double s = e.get_weight() * e.get_multiplicity();
if ( e.get_weight() > 0.0 ) { B_.ex_spikes_.add_value( e.get_rel_delivery_steps( kernel().simulation_manager.get_slice_origin() ), s ); } else { B_.in_spikes_.add_value( e.get_rel_delivery_steps( kernel().simulation_manager.get_slice_origin() ), s ); } } Thank you again and expect answers from you and anyone else. Best regards, Enguang
Hi,
Weights are properties of connections (synapses), so you'd set these (e.g. in your Python script) using something like:
nest.Connect(spikegenerator, neuron, syn_spec={'weight': 1e3})
This value is then stored in the C++ synapse instance, for example in the static synapse:
https://github.com/nest/nest-simulator/blob/2869b6364ccd85edf69246deb12c03c0...
The neuron obtains the weight from a SpikeEvent from its incoming connection by calling get_weight() on the event here, as you pointed out:
https://github.com/nest/nest-simulator/blob/2869b6364ccd85edf69246deb12c03c0...
The other multiplicative factor, multiplicity, is there to support the possibility for more than one spike to occur at the exact same time; typically this will just be equal to 1.
Your understanding of the handle(SpikeEvent&) function is correct; for more documentation about how the buffer works, see the API comments in `nestkernel/ring_buffer.h`.
The iaf neuron with alpha synapse is typically theoretically described as a differential equation, but for this particular neuron+synapse combination, there is an easy analytic solution of the differential equation. This means that we don't need a numerical integrator (like GSL provides), but that we can compute the solution directly, which is more efficient and precise. See the references at the bottom of the iaf_psc_alpha model documentation (in the .h file), especially https://doi.org/10.1007/s004220050570
With kind regards, Charl
On Wed, Dec 30, 2020, at 13:26, enguang zhou wrote:
Dear Charl, Thank for your answer. And I am also confused about the code on lines 345-346, at https://github.com/nest/nest-simulator/blob/2869b6364ccd85edf69246deb12c03c0.... The line 345 says 'V_.weighted_spikes_ex_ = B_.ex_spikes_.get_value( lag );', and does that means V_weighted_spikes_ex_ is the weight I set?
Except the last question, I also want to confirm whether I understand right to those code on lines 380-395(showed below), which is a handle invoked by spike event. First, the get_weight() will get the weight I set, multiplied by something(I don't know what it is, If you can answer that will be better ). Second the 's' variable will be stored in buffer by add_value() . Third when execute the code on 345 line(showed above) of update(), the get_value() will read out the 's' stored by add_value(). Fourth, does there a differential equation describing the membrane potential for the iaf_psc_alpha model? I know there are several neurons have differential equation such as gif_cond_exp neuron, this is at ,
https://nest-simulator.readthedocs.io/en/nest-2.20.1/models/neurons.html?hig...
iaf_psc_alpha::handle( SpikeEvent& e ) { assert( e.get_delay_steps() > 0 );
const double s = e.get_weight() * e.get_multiplicity();
if ( e.get_weight() > 0.0 ) { B_.ex_spikes_.add_value( e.get_rel_delivery_steps( kernel().simulation_manager.get_slice_origin() ), s ); } else { B_.in_spikes_.add_value( e.get_rel_delivery_steps( kernel().simulation_manager.get_slice_origin() ), s ); } } Thank you again and expect answers from you and anyone else. Best regards, Enguang _______________________________________________ NEST Users mailing list -- users@nest-simulator.org To unsubscribe send an email to users-leave@nest-simulator.org
Dear Charl, I think I have got all the answers for my questiones, thank you so much! As for the dirrerential equation, I think I need some time read that paper and I will understand more clearly. Many thanks. Enguang
Hi Charl, I have a very big problem now again for the iaf neuron(such as iaf_psc_alpha), if I don't know know differential equation for the neuron model, how can I get the derivative about some variable, such as derivative of voltage versus weight. The point is I do need to know the derivative equation of iaf_psc_alpha neuron model to design some algorithm for neural network. For the paper you mentioned, I still can't figure out the exact derivative equation of voltage or voltage state equation. https://link.springer.com/article/10.1007/s004220050570 By the way, At today's meeting, I wanted to ask that but my device had trouble when host asked, haha, so awkward. Hope for your answer or anyone else. Thank you. Enguang