Skip to content

Conversation

Tetracarbonylnickel
Copy link
Contributor

Previously, using break only exited the training loop but did not close the surrounding with context. As a result, early stopping did not terminate training properly.
This change ensures that early stopping exits the context manager as well, allowing training to terminate cleanly.

@Tetracarbonylnickel Tetracarbonylnickel requested review from PythonFZ and M-R-Schaefer and removed request for PythonFZ September 2, 2025 11:43
Copy link
Contributor

@PythonFZ PythonFZ left a comment

Choose a reason for hiding this comment

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

Seems like a good change. There are also some other restructurings in the training loop that look good, but I'd suggest either now or in a future PR to refactor this a little bit and see if e.g. train / val steps can be written as separate functions making changes easier to review.

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