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

synaptic.py has sth wrong #349

Open
YOUNGLBIN opened this issue Oct 5, 2024 · 1 comment
Open

synaptic.py has sth wrong #349

YOUNGLBIN opened this issue Oct 5, 2024 · 1 comment

Comments

@YOUNGLBIN
Copy link

  • snntorch version:
  • Python version:
  • Operating System:

Description

When I use snn.Synaptic, something unexpected happened. So I check the synaptic.py, i found the 219line "self.syn = mem" should be replaced with "self.syn = syn". I done this in my local computer, Things have become normal now

What I Did

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
@Roiwa
Copy link

Roiwa commented Oct 21, 2024

Agreed! I have the same issue while making tutorial 4.

Nevertheless, I think the correct way to use Synaptic is to instantiate the neuron:
lif1 = snn.Synaptic(alpha=alpha, beta=beta)
Then initialize the neuron:
syn, mem = lif1.init_synaptic(). In fact, nowadays, we have to use syn, mem = lif1.reset_mem()
and while calling the neuron we need to use:
spk_out, syn, mem = lif1(spk_in[step]),
instead of spk_out, syn, mem = lif1(spk_in[step],syn,mem), as it uses syn and mem attributes (self.syn and self.mem)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants