Repository navigation
Weight validation minibatch losses by their example counts - #53
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
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.
Summary
Fixes #52.
Aggregate validation cross entropy by example count instead of giving every minibatch equal weight. A partial final minibatch previously had disproportionate influence on validation scores and best-checkpoint selection. Training updates, training-loss reporting, regularization and the TPR-at-FPR branch are unchanged.
Validation
python -m pytest -q src/synthid_text/logits_processing_test.py src/synthid_text/detector_validation_test.py23 tests passed. All existing logits-processing tests and eight new validation cases pass. Five new cases fail on unchanged upstream; three partition controls pass. The tests execute the actual Flax detector and train loop, compare every epoch with direct full-set cross entropy, test validation-order invariance, and verify checkpoint selection after a real two-epoch parameter update. The existing suite emitted five PyTorch batching-performance warnings. No language-model checkpoint, tokenizer download, generated corpus, GPU or production detector calibration was used. This does not change single-epoch/no-validation edge cases or claim CPU training quality at production scale.
Tested locally on macOS CPU using real module imports. New-test formatting, scoped static checks, syntax checks and
git diff --checkpass. No dependency or workflow changes. The full repository suite was not run.