-
Notifications
You must be signed in to change notification settings - Fork 88
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
fix invalid refractory period of reduced models with Delta synapses #387
Conversation
It's a great PR. We will discuss more for solving this issue. |
Thanks for reply. The settings you presented fixed my issue well. Sorry that I just miss the |
Thank you for a very good suggestion, we will add clearer notes as soon as possible to help people understand the model better. |
I believe this issue has been well addressed and further updates will be coming soon. |
Description
How Has This Been Tested
The setting of refractory period in reduced models is invalid when I using Delta synapses. Here is my test code.
Typically since the
tau_ref=20.
, the maximum firing rate of the LIF neuron should be 50 Hz. However, the simulation above returns the 110 Hz firing rate.The reason of this issue is that
Delta
synapses directly target to the membrane potentialsself.V.value
, which are updated before the integration of membrane potential.BrainPy/brainpy/_src/neurons/reduced_models.py
Line 431 in d2c40da
Therefore, the neuron will integrate the driven from Delta synapses even thought it's in refractory period.
https://github.com/brainpy/BrainPy/blob/d2c40daabbef8acbe82cc93e31e5bee42735c855/brainpy/_src/neurons/reduced_models.py#LL438C40-L438C40
I've change the update of
V
according torefractory
withV = bm.where(refractory, self.V_reset, V)
. It solves the issue of invalidness of refractory.However, I'm not sure whether my change will cause any trouble for networks in training mode.
Types of changes
Checklist
Other information
Two typos in the tutorial documents are fixed.