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

leaky and rleaky state function substract fix #95

Merged
merged 3 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .idea/misc.xml

This file was deleted.

21 changes: 0 additions & 21 deletions .idea/snntorch.iml

This file was deleted.

2 changes: 1 addition & 1 deletion snntorch/_neurons/leaky.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def _base_state_function(self, input_, mem):
def _build_state_function(self, input_, mem):
if self.reset_mechanism_val == 0: # reset by subtraction
state_fn = (
self._base_state_function(input_, mem) - self.reset * self.threshold
self._base_state_function(input_, mem - self.reset * self.threshold)
)
elif self.reset_mechanism_val == 1: # reset to zero
state_fn = self._base_state_function(
Expand Down
3 changes: 1 addition & 2 deletions snntorch/_neurons/rleaky.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ def _base_state_function(self, input_, spk, mem):
def _build_state_function(self, input_, spk, mem):
if self.reset_mechanism_val == 0: # reset by subtraction
state_fn = (
self._base_state_function(input_, spk, mem)
- self.reset * self.threshold
self._base_state_function(input_, spk, mem - self.reset * self.threshold)
)
elif self.reset_mechanism_val == 1: # reset to zero
state_fn = self._base_state_function(
Expand Down