Closed realbb closed 2 months ago
When I check parameter mem_rec, here's what I got: Tensor 0: tensor([0.9000]) Tensor 1: tensor(0.) Tensor 2: tensor(0.) ....
It seems the code from for statement spk_out, mem = lif1(cur_in[step], mem) is giving mem a empty tensor.
It seems like the latest update of pytorch has caused torch.stack() to behave differently.
This can be overwritten by just setting mem_rec = []
, but then I noticed the neuron behaviour is incorrect.
I'll need to go over this carefully to figure out what's going wrong.
@realbb You can fix the problem by adding a dimension to the neuron input spk_out, mem = lif1(cur_in[step].reshape(1), mem)
or directly to the input tensor when you create it cur_in = torch.zeros(num_steps,1)
@jeshraghian If the Lapicque neuron implementation is working as expected and this is due to a change in the Torch implementation I volunteer to submit a PR with all the tutorials fixed so they work again.
@Gabo-Tor that'd be great. Let's go via cur_in = torch.zeros(num_steps,1)
because then the intuition could be that the dimension of '1' is like a batch dimension. We will need to update the notebook and the rst file in docs/tutorials/tutorial_2.rst
I haven't had a chance to check if other tutorials are affected by this, but I feel like they will be.
@jeshraghian I'll fix those two files and check the other tutorials.
Is here still work to do, @Gabo-Tor ?
Is here still work to do, @Gabo-Tor ?
@ahenkes1 Nope, it is fixed now, this issue should probably be closed
Description
Hello. I'm trying your tutorial 2, which is about Lapicque's LIF neuron model. I was following your directions but this kind of error has occurred.
code:![image](https://github.com/jeshraghian/snntorch/assets/62462277/c9e788e5-cd0d-4bf2-af1b-d63522eeec00)
err:![image](https://github.com/jeshraghian/snntorch/assets/62462277/fa286915-ae10-41e1-b036-0db821519ebe)
Actually, I have done this tutorial at Nov.2023. At then there was no error. Can you tell me what is wrong?
Thanks for reading.