Skip to content

Fix EarlyStopping using stale losses between display steps - #2109

Open
maximbeekenkamp wants to merge 1 commit into
lululxvi:masterfrom
maximbeekenkamp:fix/early-stopping-fresh-loss
Open

maximbeekenkamp wants to merge 1 commit into
lululxvi:masterfrom
maximbeekenkamp:fix/early-stopping-fresh-loss

Conversation

@maximbeekenkamp

Copy link
Copy Markdown

Fixes #2048.

EarlyStopping checks the loss every iteration, but the training loop only refreshes it at display_every intervals. This can exhaust patience while the loss is still improving.

With this change, attaching EarlyStopping evaluates losses every iteration. Printing and loss history keep their configured interval, with the stopping step also recorded. This adds evaluation cost when early stopping is enabled.

Validated with analytically calculated supervised and PDE losses across all five CPU backends. All 13 PyTorch CUDA integration cases passed on an RTX 3090. Existing external-optimizer limitations remain unchanged.

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.

EarlyStopping behavior

1 participant