-
Notifications
You must be signed in to change notification settings - Fork 27.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚀 Add early stopping to the trainer #4894
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Looking at the interest this topic has, I am bumping it to re-open it. |
If I've understood things correctly, I think #4186 only addresses the Pytorch implementation of the trainer. @BramVanroy if that's the case I'm happy to work on implementing this feature in Tensorflow (trainer_tf.py). |
Thanks for clarifying @BramVanroy. Apologies I was out for the past month due to a personal issue. I'll submit a PR for Tensorflow early stopping now. |
An early stopping callback has now been introduced in the PyTorch trainer by @cbrochtrup! 👏 AFAIK the implementation the TF Trainer is still under way (#7533) so I'll keep this topic open for now. |
I gather from the conversation on #7533 that this issue should now be closed; is that correct, @BramVanroy ? |
🚀 Feature request
The trainer (pt, tf) is an easy access point for users who rather not spend too much time building their own trainer class but prefer an out-of-the-box solution. Even though
transformers
was never meant to be a fully fletched training library, it might please users to add an additional feature: early stopping.Motivation
Early stopping ensures that the trainer does not needlessly keep training when the loss does not improve. This saves time, money, and let's not forget the trees. 😉 Performance-wise this should not lead to different results.
Your contribution
At the moment I cannot work on this, but here are my thoughts:
evaluate_during_training
is enabled.tf.keras.callbacks.EarlyStopping
.The text was updated successfully, but these errors were encountered: