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

lif subthr_dynamics() for 'fixed_pt' doesn't properly wrap neuron current #334

Closed
2 tasks done
JuliaA369 opened this issue Sep 7, 2022 · 0 comments · Fixed by #364
Closed
2 tasks done

lif subthr_dynamics() for 'fixed_pt' doesn't properly wrap neuron current #334

JuliaA369 opened this issue Sep 7, 2022 · 0 comments · Fixed by #364
Assignees
Labels
1-bug Something isn't working

Comments

@JuliaA369
Copy link

Objective of issue: Fix subthr_dynamics() function for fixed point lif model so that neuron current wraps to opposite side of integer range rather than to 0.

Lava version:

  • 0.4.0 (current version)
  • 0.3.0

I'm submitting a ...

  • [ x] bug report

Current behavior:

  • Right now on integer overflow of current, the current wraps back around to 0

Expected behavior:

  • You'd expect the current to wrap around to -2^23 if the current is positively accumulating or +2^23 if accumulating negatively. The comments imply that this is also the expected behavior

Steps to reproduce:

  • Set current decay to be really slow, and have a bunch of spiking inputs go into a single neuron, then probe current and look at it on the plot

Related code:

insert short code snippets here

Other information:

A simple way to fix this issue is to go into lava/proc/lif/models.py, then find the fixed point version of subthr_dynamics() and change the wrapped_curr computation to the following:

wrapped_curr = np.where(decayed_curr>self.max_uv_val, decayed_curr - 2*self.max_uv_val,
                 decayed_curr)
wrapped_curr = np.where(wrapped_curr<=-self.max_uv_val, decayed_curr + 2*self.max_uv_val,
                 wrapped_curr)   
@PhilippPlank PhilippPlank added the 1-bug Something isn't working label Sep 13, 2022
@PhilippPlank PhilippPlank self-assigned this Sep 13, 2022
@PhilippPlank PhilippPlank mentioned this issue Sep 23, 2022
16 tasks
@PhilippPlank PhilippPlank linked a pull request Sep 23, 2022 that will close this issue
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants