Skip to content

Loss recording#183

Draft
neworderofjamie wants to merge 6 commits intoml_genn_3from
loss_metrics
Draft

Loss recording#183
neworderofjamie wants to merge 6 commits intoml_genn_3from
loss_metrics

Conversation

@neworderofjamie
Copy link
Contributor

@neworderofjamie neworderofjamie commented Dec 9, 2025

After some thought and fiddling, my conclusion is that loss is a compiler-specific thing and needs calculating in the backward pass so recording it isn't really something that can be easily or sensibly implemented as a metric. Therefore, this PR adds functionality to generate loss-calculating terms to the event prop backward pass and stores the data in a callback added by the compiler (in the same way rewiring stats are stored with Deep-R in #94).

However, I cannot quite figure out how all the calculations works in the original genn_eventprop code

@codecov-commenter
Copy link

codecov-commenter commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 59.61538% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.40%. Comparing base (24c3282) to head (1bef0b7).

Files with missing lines Patch % Lines
ml_genn/ml_genn/compilers/event_prop_compiler.py 53.48% 20 Missing ⚠️
..._genn/ml_genn/losses/relative_mean_square_error.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           ml_genn_3     #183      +/-   ##
=============================================
- Coverage      77.56%   77.40%   -0.17%     
=============================================
  Files            114      114              
  Lines           4788     4833      +45     
=============================================
+ Hits            3714     3741      +27     
- Misses          1074     1092      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@neworderofjamie neworderofjamie mentioned this pull request Feb 5, 2026
@neworderofjamie neworderofjamie changed the base branch from ml_genn_3 to super_tidy February 5, 2026 12:21
Base automatically changed from super_tidy to ml_genn_3 February 5, 2026 16:32
* Only -log() SCE loss, square MSE-adjacent losses
* Only add per-trial loss once per-trial
* Use seperate python classes for the two classes of loss function - MSE requires sqrt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants