Skip to content

Fix best model - #38

Merged
wli51 merged 8 commits into
WayScience:mainfrom
wli51:fix-best-model
Aug 6, 2026
Merged

Fix best model#38
wli51 merged 8 commits into
WayScience:mainfrom
wli51:fix-best-model

Conversation

@wli51

@wli51 wli51 commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

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.py is mostly migrated tests from tests/trainers/test_abstract_trainer.py refactored to be testable independent of the trainer realization.

wli51 added 4 commits August 3, 2026 17:09
…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.
@wli51
wli51 requested a review from MattsonCam August 3, 2026 23:37

@MattsonCam MattsonCam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This LGTM, good job @wli51 !

Comment thread src/virtual_stain_flow/trainers/AbstractTrainer.py
Comment thread src/virtual_stain_flow/models/model.py
Comment thread src/virtual_stain_flow/trainers/AbstractTrainer.py
wli51 added 4 commits August 4, 2026 17:28
…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.
@wli51

wli51 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

@MattsonCam Thanks for reviewing! Addressed all comments. Merging now!

@wli51
wli51 merged commit b48d3a5 into WayScience:main Aug 6, 2026
2 checks passed
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