Repository navigation
TrainingConfig.scheduler_monitor: choisir la métrique de ReduceLROnPlateau - #121
Merged
Merged
Conversation
Follow-up to #120. TrainingConfig gets scheduler_monitor (default None: same metric as early stopping, i.e. val_loss with a validation set, train_loss otherwise). Setting it to "train_loss" keeps the previous behaviour. Asking for a val_* metric without a validation set raises a clear ValueError instead of an obscure Lightning error. Docs: document scheduler_monitor, which metric early stopping and checkpointing watch, the patience constraint with ReduceLROnPlateau (PyTorch default patience is 10), and add a ReduceLROnPlateau example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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.
Suite de #120.
Changements
TrainingConfig.scheduler_monitor(Optional[str], défautNone) :None: même métrique que l'early stopping et le checkpointing (val_losss'il y a un jeu de validation, sinontrain_loss). C'est le comportement de ReduceLROnPlateau: monitor val_loss like early stopping #120."train_loss": on garde l'ancien comportement (réduction du LR sur la loss d'entraînement) même avec un jeu de validation.val_accuracy, avecmode="max"dansscheduler_params).val_*sans jeu de validation lève uneValueErrorexplicite au lieu d'une erreur Lightning peu lisible.docs/source/api/configs.rst,docs/source/api/model.rst) :scheduler_monitor;ReduceLROnPlateau(le défaut PyTorch est 10, contre 3 pour l'early stopping) ;ReduceLROnPlateau.Tests
Ajouts dans
tests/test_scheduler_monitor.py: forcertrain_lossavec un jeu de validation, etval_losssans jeu de validation →ValueError.test_scheduler_monitor.py,test_sample_weights.pyettest_torchTextClassifiers.pypassent (25 tests). La doc Sphinx n'a pas été générée en local (Sphinx n'est pas installé dans l'environnement).🤖 Generated with Claude Code