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

Spike time quantisation #86

Closed neworderofjamie closed 9 months ago

neworderofjamie commented 9 months ago

Spike data coming from tonic often can easily have multiple events assigned to one neuron in a timestep, especially if the Downsample transformation is applied. Previously, preprocess_tonic_spikes converted the tonic events directly to spike-source array format but this PR adds an option to apply a 2D (neuron id, timestep) histogram and threshold this to obtain events. histogram_thresh = 1 will simply remove duplicate spikes and higher numbers will counter-act the noise amplification effect of the Downsample

Also, as I didn't want to make another PR, this includes a fix for a bug in LeakyIntergrator output neuron model where bias term was never being applied - this really degrades e-prop performance.

codecov-commenter commented 9 months ago

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (1b7880f) 62.31% compared to head (fb93034) 62.19%.

Files Patch % Lines
ml_genn/ml_genn/utils/data.py 0.00% 9 Missing :warning:
ml_genn/ml_genn/neurons/leaky_integrate.py 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #86 +/- ## ========================================== - Coverage 62.31% 62.19% -0.13% ========================================== Files 100 100 Lines 3888 3896 +8 ========================================== Hits 2423 2423 - Misses 1465 1473 +8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.