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

Fix the PyLifRefractoryModelFloat class' subthreshold dynamics #841

Open
monkin77 opened this issue Mar 20, 2024 · 0 comments · May be fixed by #842
Open

Fix the PyLifRefractoryModelFloat class' subthreshold dynamics #841

monkin77 opened this issue Mar 20, 2024 · 0 comments · May be fixed by #842
Labels
0-needs-review For all new issues 1-bug Something isn't working

Comments

@monkin77
Copy link

Describe the bug
The PyLifRefractoryModelFloat model does not update the voltage correctly in its sub-threshold dynamics. The current equation is:
image
instead of:
image
. Therefore, the voltage of the neurons is updated incorrectly.

To reproduce current behavior
Steps to reproduce the behavior:

  1. If you create a RefractoryLIF Process like so:
# Create LIF1 process
lif1 = LIFRefractory(shape=(2,),  # There are 2 neurons
            vth=1.0,
            v=0,
            dv=0.1,    # Inverse of decay time-constant for voltage decay
            du=0.2,  # Inverse of decay time-constant for current decay
            bias_mant=0,
            bias_exp=0,
            refractory_period=10,
            name="lif1")

and you try to stimulate this Refractory LIF layer with an input, the voltage will always remain at 0 since the initial voltage is 0 and the equation representing the sub-threshold dynamics is wrong (it multiplies the voltage of the previous timestep by the inverse of the decay time-constant + current). So it's always multiplying by 0.

Expected behavior
As it stands, it is expected that the LIFRefractory model does not update the voltage dynamics correctly for the reasons mentioned above. By looking at the screenshot below, we can see that the current dynamics are correct, but the voltage dynamics are not.

Screenshots
image

Environment:

  • Device: Laptop
  • OS: Linux
  • Lava version: Latest commit (19/03/2024)

Additional context
This is observed in the PyLifRefractoryModelFloat class that implements the refractory period behavior in a LIF model neuron running on a CPU.

@monkin77 monkin77 added the 1-bug Something isn't working label Mar 20, 2024
@github-actions github-actions bot added the 0-needs-review For all new issues label Mar 20, 2024
@monkin77 monkin77 linked a pull request Mar 20, 2024 that will close this issue
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-needs-review For all new issues 1-bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant