synsense / sinabs

A deep learning library for spiking neural networks which is based on PyTorch, focuses on fast training and supports inference on neuromorphic hardware.
https://sinabs.readthedocs.io
GNU Affero General Public License v3.0
77 stars 8 forks source link

Automatic instantiaion of individual time constants per neuron #42

Open bauerfe opened 2 years ago

bauerfe commented 2 years ago

Currently the shape of time constant parameters (alpha_xxx or tau_xxx) in the LIF layer is determined by what has been provided during class instantiation.

If a user wants individual time constants (one per neuron), they have to provide a tensor with corresponding shape.

I suggest introducing an additional option, individual_time_constants. When it is set to True, the time constants of the layer will be expanded to the number of neurons (without batch size). when calling forward. This makes it possible to train time constants on a per-neuron base, while still having the comfort of just passing a scalar initial value at instantiation.

When the new parameter is False (default), the behavior is the same as now.

sheiksadique commented 8 months ago

@bauerfe this is now fixed right?

bauerfe commented 7 months ago

No. Looks like this one got overlooked. Would you like me to take care of it?

sheiksadique commented 7 months ago

Perhaps not now. Since this is not a feature that exists on speck, I would say this is low priority.