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: Forward pass logic on snn.synaptic neuron #362

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
7 changes: 3 additions & 4 deletions snntorch/_neurons/synaptic.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,8 @@ def init_synaptic(self):
return self.reset_mem()

def forward(self, input_, syn=None, mem=None):

if not syn == None:
self.syn = mem
self.syn = syn

if not mem == None:
self.mem = mem
Expand Down Expand Up @@ -252,9 +251,9 @@ def forward(self, input_, syn=None, mem=None):
spk / self.graded_spikes_factor - self.reset
) # avoid double reset
if self.reset_mechanism_val == 0: # reset by subtraction
mem = mem - do_reset * self.threshold
self.mem = self.mem - do_reset * self.threshold
elif self.reset_mechanism_val == 1: # reset to zero
mem = mem - do_reset * mem
self.mem = self.mem - do_reset * self.mem

if self.output:
return spk, self.syn, self.mem
Expand Down