Skip to content

Fix LSTM benchmark to evaluate on test set#263

Merged
jasonlyik merged 4 commits intodevfrom
correct_mg_bench
Jun 20, 2025
Merged

Fix LSTM benchmark to evaluate on test set#263
jasonlyik merged 4 commits intodevfrom
correct_mg_bench

Conversation

@YounesBouhadjar
Copy link
Contributor

Fixes #262
The benchmark is corrected to evaluate LSTM on the test set, using the hidden states warmed up at the end of training.

@codecov
Copy link

codecov bot commented Jun 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.63%. Comparing base (aefdbaf) to head (a2a7026).
Report is 5 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #263   +/-   ##
=======================================
  Coverage   77.63%   77.63%           
=======================================
  Files          43       43           
  Lines         805      805           
  Branches      119      119           
=======================================
  Hits          625      625           
  Misses        133      133           
  Partials       47       47           
Flag Coverage Δ
unittests 77.63% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@jasonlyik
Copy link
Contributor

Thanks @YounesBouhadjar, I think there was just one small issue -

When the hidden states are populated in the last epoch of the training at L139, there is still an optimizer step / weight update after that.

So I believe that the hidden states initialized for testing would be using the weights after the second-to-last update, rather than the weights after the final update.

I changed it to re-run the forward pass on the train data before the benchmark run on the test set, and also re-did the benchmark, but the difference in results is negligible.

Copy link
Contributor

@jasonlyik jasonlyik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update corrects the issue with the test dataset for the LSTM Mackey-Glass benchmark.

@jasonlyik jasonlyik merged commit 4fa2cfb into dev Jun 20, 2025
6 checks passed
@jasonlyik jasonlyik deleted the correct_mg_bench branch December 30, 2025 16:27
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.

3 participants