genn-team / ml_genn

A library for deep learning with Spiking Neural Networks (SNN).
https://ml-genn.readthedocs.io
GNU Lesser General Public License v2.1
24 stars 7 forks source link

compile_state.tau_mem is not set for LeakyIntegrate in EProp Compiler #97

Closed FabianSchubert closed 3 months ago

FabianSchubert commented 3 months ago

Using LeakyIntegrate as an output seems to cause an assertion error assert self._tau_mem is not None when trying to compile with EPropCompiler. My guess is that https://github.com/genn-team/ml_genn/blob/1a27df5c561f40a70783a4b43ff76f0b54e22dbd/ml_genn/ml_genn/compilers/eprop_compiler.py#L419-L420

should just include LeakyIntegrate so that compile_state.tau_mem is set?

neworderofjamie commented 3 months ago

That branch is only for hidden neurons and, in the standard e-prop framework, output neuron time constant is different from the one which dictates the time constant in the learning rule:

image

Do you definitely have readout set for your LeakyIntegrate output? The only other way I can see that error happening is if you have no other neurons with tau in the network.

FabianSchubert commented 3 months ago

Yes, I directly connected a spiking input population to the LeakyIntegrate output, so indeed there were no other neurons with tau. It was just a linear regression toy model that I was trying to set up, so this error probably doesn't have any practical relevance.