Fix best model - #38
Merged
Merged
Conversation
…saving, in preparation for refactoring of `AbstractTrainer`.
…rlyStopHelper remove internal logic. Remove `AbstractTrainer` attributes that are not used by any other components of this software and no longer updated by the most recent trainer implementation. Centralize save model implementation as previous realizations across the two trainer classes are effectively identical. Add tests to contract new trainer model saving behavior when validiation set is not present.
…havior and refactor early stopping logic
MattsonCam
approved these changes
Aug 4, 2026
MattsonCam
left a comment
Member
There was a problem hiding this comment.
This LGTM, good job @wli51 !
…nly once at start when the model is moved to CPU, subsequent best model updates happen by copying of state dict
… validation set; add validation presence check for early termination metric.
…nts and add CPU-safe test execution
…eparate CPU-safe test execution steps
Collaborator
Author
|
@MattsonCam Thanks for reviewing! Addressed all comments. Merging now! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixing incorrect best model updating and saving behavior, and related refactor of early termination functionality to reduce trainer module size.
Note:
src/virtual_stain_flow/trainers/trainer_utils/early_stop.pyis mostly migrated tests fromtests/trainers/test_abstract_trainer.pyrefactored to be testable independent of the trainer realization.