NeuroBench / neurobench

Benchmark harness and baseline results for the NeuroBench algorithm track.
https://neurobench.readthedocs.io
Apache License 2.0
46 stars 11 forks source link

Fix AttributeError: 'Leaky' object has no attribute 'mem' #218

Closed ben9809 closed 1 month ago

ben9809 commented 1 month ago

The current implementation of SNNTorch version 0.7.0 does not set the membrane potential (mem) as an attribute of the neuron classes (Leaky, Synaptic, etc...) unless the neuron is initialized with the option init_hidden=True. As a result, any hooks that attempt to register the pre- and post-membrane potentials will fail if this option is not enabled.

This pull request resolves this issue by ensuring that the mem attribute is properly set when the init_hidden=True option is used. Additionally, it updates the necessary documentation to guide users on correctly configuring their networks if they need to register membrane potential updates.

jasonlyik commented 1 month ago

Looks good