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

Event-prop bug fixes #110

Closed neworderofjamie closed 2 months ago

neworderofjamie commented 2 months ago

This PR fixes several issues which somehow only came to light when trying to train SSC.

  1. Gradients were being optimised and reduced in 1st batch when they are invalid
  2. During validation, gradients are still accumulated - this is fine but they weren't being zeroed before the next epoch of training. An additional custom update is now generated to do this.

Also, this PR modifies CompiledTrainingNetwork.train to take a seperate list of validation callbacks, preventing irritating issues around e.g. checkpointing and learning rate schedules.

codecov-commenter commented 2 months ago

Codecov Report

Attention: Patch coverage is 28.94737% with 27 lines in your changes missing coverage. Please review.

Project coverage is 65.28%. Comparing base (7d7ce54) to head (13f3503).

Files Patch % Lines
ml_genn/ml_genn/compilers/event_prop_compiler.py 23.33% 23 Missing :warning:
ml_genn/ml_genn/callbacks/custom_update.py 50.00% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## delays #110 +/- ## ========================================== - Coverage 65.44% 65.28% -0.16% ========================================== Files 101 101 Lines 4173 4200 +27 ========================================== + Hits 2731 2742 +11 - Misses 1442 1458 +16 ```

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