-
Notifications
You must be signed in to change notification settings - Fork 362
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
Added neuron model aeif_cond_beta_multisynapse using GSL ODE solver (see issue 438) #439
Conversation
…nsion of aeif_cond_alpha_multisynapse. It allows an arbitrary number of synaptic rise time and decay time constant. Synaptic conductance is modeled by a double exponential function.
Fixed example in aeif_cond_2exp_multisynapse.h
@golosio Thank you for your contribution! We are currently trying to properly understand and handle some numerical issues with aeif models in general (see #229). I would prefer to solve them in the simple case of the Another pre-requisite for merging your model into the NEST master repository is a signed Contributor License Agreement, which you can download from our website and send me by mail. |
@heplesser Sure, that's fine. Meanwhile I added the (equivalent) model aeif_cond_beta_multisynapse. I compared the two and they give the same results, which is not surprising as the underlying differential equations have the same solutions. aeif_cond_beta_multisynapse is closer to the original model aeif_cond_alpha_multisynapse, and it is based on the same differential equations as those proposed by dnao in "Create iaf_cond_beta" #405 . so it should be a quicker review, when you feel you can do it. By the way, if you think it can be useful I can help with the revision of iaf_cond_beta. Let me know... |
@golosio I am a bit confused: isn't the beta function precisely the difference-of-two-exponentials? So what precisely is the difference between the Btw, our preferred integrator for AEIF neurons is at present the GSL ODE solver used in Concerning contributions to #405, I'd suggest that you contact @dnao directly, since it is his/her code. |
Right, the beta function is the difference of two exponential. The two models differ because they are based on a slightly different (but equivalent) system of differential equations, which have the same solution (i.e. the beta function) and it is probably superfluous to have both, but it was useful for me as a check of consistency. Sure, I'll have a look at the GSL ODE solver and see how difficult it would be to adapt my code for it. |
@golosio Good. While cross-validation of models is very useful, we want to keep the number of models in the NEST distribution within sensible limits. So I would suggest that you remove the |
Sure, that's easy! |
@heplesser I removed the 2exp variant |
@heplesser ok, I'm working on the gsl ode version, it should not be too much work if I use aeif_cond_alpha as a base. |
@heplesser ok, I adapted my code for using the GSL ODE solver and tested it. You can find the new version in the updated pull request. |
gracefully if GLS is not installed.
@jougs Do you have any objections to merging this PR now that all tests have passed? |
@heplesser: I was just commenting here because of the failing builds, not as a reviewer. Maybe @ingablundell or @DimitriPlotnikov could have a look? |
@heplesser @jougs my first impression is that the model is implemented well. Before I proceed with more detailed review, I would have an acknowledgment that the model is important enough to be included into NEST repository. |
Thank you @DimitriPlotnikov. |
@DimitriPlotnikov Yes, the model is relevant (otherwise I wouldn't have given it a thumb up). |
@heplesser Thank you for your replay. I still a bit confused with this 'kitschy' emojies which can appear at arbitary place in the discussion. I'll tackle it next week. |
|
||
/** buffers and sums up incoming spikes/currents */ | ||
std::vector< RingBuffer > spike_exc_; | ||
std::vector< RingBuffer > spike_inh_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I need qualified help of @heplesser:
We already discussed the issue with our interpretation of inhibitory and excitatory buffers in the current NEST state. In a model with one buffer (iaf_psc_exp) the logic to use the sigh of the weight to route spike events is at least plausible. In the case of the mutlisynapse model it leads to: a) you always have the same number of inh und exc buffers b) you have to buffers (inh/exc) at the same portnumber c) finally, this implementation is inconsistent with the implementation of the iaf_psc_alpha_multisynapse and iaf_psc_exp_multisynapse.
@DimitriPlotnikov I took as reference aeif_cond_alpha_multisynapse, but I agree with your observations. If you already discussed this issue for the iaf_psc_*_multisynapse models, probably there is no reason to keep two separate buffers for inhibitory and excitatory connections. We have to be careful that in conductance based models the driving force is different for inhibitory vs excitatory signals, but this should not be a big deal. I will try to modify the code and let you know. |
…xcitatory connections. In this commit only one buffer is used, and the weight sign is used to route spike events.
@DimitriPlotnikov I modified the code according to your comment. Now there is only one buffer for both types of events, inhibitory or excitatory. |
@golosio @DimitriPlotnikov The issue of the exc/inh buffer also occurs in #261 for the gif_cond_exp_multisynapse models. I put it on the agenda for the NEST developer VC on 19 Sept. |
@heplesser @DimitriPlotnikov maybe we should seek a more general solution (see the issue that i just opened #477 ). My opinion is that I would not ask Hesam to review his code once more for this issue before merging it, after all it only affects performances, it can be fixed at a later stage. |
@DimitriPlotnikov Did you have a chance to check the code with the changes that I made to meet your observation? Do you have other amendments to propose? |
I'll do it tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the implementation perspective the model is well implemented. I also wrote an "brunel" simulation based on the provided model and it produced some results (Excitatory rate : 4.40 Hz, Inhibitory rate : 10.20 Hz)
e.g. non zero rates. After fixing mentioned 2 minor issues, it can be finally approved.
// denominator is computed here to check that it is != 0 | ||
double denom1 = P_.taus_decay[ i ] - P_.taus_rise[ i ]; | ||
double denom2 = 0; | ||
if ( denom1 != 0 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add an informative comment why are you doing this computation and checks? Can it be already detected in the Parameters_::set?
Adapted by Bruno Golosio from aeif_cond_alpha_multisynapse | ||
SeeAlso: aeif_cond_alpha_multisynapse | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to run the example that you provide in the commet. I would add
import nest
import numpy as np
to make it an executable python program.
Another issue is that the resulting script fails at my machine with the following stacktrace:
Traceback (most recent call last):
File "aeif_cond_alpha_multisynapse.py", line 24, in <module>
nest.Connect(spike, neuron, syn_spec="synapse2")
File "/home/nestml/repositories/nest_repo/bld_master_nompi/lib/python2.7/site-packages/nest/lib/hl_api_helper.py", line 230, in stack_checker_func
return f(*args, **kwargs)
File "/home/nestml/repositories/nest_repo/bld_master_nompi/lib/python2.7/site-packages/nest/lib/hl_api_connections.py", line 314, in Connect
sr('Connect')
File "/home/nestml/repositories/nest_repo/bld_master_nompi/lib/python2.7/site-packages/nest/__init__.py", line 91, in catching_sli_run
errorname, commandname, message))
pynestkernel.NESTError: IllegalConnection in Connect_g_g_D_D: Creation of connection is not possible because:
All outgoing connections from a device must use the same synapse type.
Am I doing something wrong? Otherwise, could you fix the comment?
@DimitriPlotnikov Thank you for your review. I made the changes that you requested. I improved the comments and completed the example. I already noticed that the example provided in aeif_cond_alpha_multisynapse don't work, see my comments at the end of #439 (comment) and the following reply from @heplesser . On the other hand, I fixed my example and it should work. |
This PR can be merged. |
Thank you @DimitriPlotnikov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@golosio Thank you for your efforts! The code is ready for merge 👍!
Multisynaptic neuron model with synaptic conductance modeled by the sum of two exponential functions, with independent synaptic rise times and decay times, as described in A. Roth and M.C.W. van Rossum in Computational Modeling Methods for Neuroscientists, MIT Press 2013, Chapter 6. The model is an extension of the conductance based exponential integrate-and-fire neuron model according to Brette and Gerstner (2005), as implemented in aeif_cond_alpha_multisynapse
This pull request deal with the issue #438