Skip to content

Exclude validation sanity checks from history - #159

Merged
giovannivolpe merged 1 commit into
DeepTrackAI:developfrom
foca13:ignore-sanity-check-val-history
Oct 28, 2026
Merged

giovannivolpe merged 1 commit into
DeepTrackAI:developfrom
foca13:ignore-sanity-check-val-history

Conversation

@foca13

@foca13 foca13 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Lightning automatically runs a validation step before training to avoid crashing in the validation loop sometime deep into a lengthy training loop. Deeplay's LogHistory class (which inherits from L.Callback) counts this step as the fist validation step in the training process, producing untruthful validation curves. It can be seen in the following MNIST example, where the model randomly predicts the digit chosen for the sanity check and the starting validation accuracy is 100%:

sanity_check_included

wrong, sanity check included as validation step (11 val steps vs 10 train steps), current form

sanity_check_ignored

correct, sanity check ignored (10 val steps & 10 train steps), fixed with this PR

This PR adds two lines of code (+ test) that keep the sanity check but don't include it in the training logs.

@foca13 foca13 changed the title Exclude validation sanity checks from training history Exclude validation sanity checks from history Oct 27, 2026
@foca13
foca13 force-pushed the ignore-sanity-check-val-history branch 2 times, most recently from 37bf164 to 8e9c602 Compare October 27, 2026 14:46
@foca13
foca13 force-pushed the ignore-sanity-check-val-history branch from 8e9c602 to bc3d174 Compare October 28, 2026 11:30
@giovannivolpe
giovannivolpe merged commit 0ba6bc3 into DeepTrackAI:develop Oct 28, 2026
18 checks passed
@foca13
foca13 deleted the ignore-sanity-check-val-history branch October 28, 2026 12:58
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