feat: add NoImprovementHandler#3760
Draft
Aanushka001 wants to merge 2 commits into
Draft
Conversation
Collaborator
|
Hi, I think the issue meant this handler should take a custom function or method and execute it in case of no improvement. Currently the implementation looks a loot like early stopping instead of a modular handler. |
Author
|
Thanks for the feedback! I've updated the PR to add a `custom_action`
parameter. Users can now pass any callable to execute on no improvement
(e.g., reducing LR, checkpointing, logging, or terminating) instead of
being restricted to just trainer termination. The trainer parameter is now
optional when custom_action is provided.
Here's the commit:
Aanushka001@9da7116
Would appreciate a re-review when you get a chance!
…On Tue, Jun 02, 2026 at 07:15 AM, Aaishwarya Mishra < ***@***.***> wrote:
*aaishwarymishra* left a comment (pytorch/ignite#3760)
<#3760 (comment)>
Hi, I think the issue meant this handler should take a custom function or
method and execute it in case of no improvement. Currently the
implementation looks a loot like early stopping instead of a modular
handler.
—
Reply to this email directly, view it on GitHub
<#3760?email_source=notifications&email_token=BCZDYVXJXHWCMJ5SLYCCL3L45Z5JDA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINJZHE3DMOBSGQZ2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4599668243>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BCZDYVX4TYNAR7I2NKWN3IT45Z5JDAVCNFSM6AAAAACZUHM7EKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DKOJZGY3DQMRUGM>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/BCZDYVVMTDEHIV3IHKERJKT45Z5JDA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINJZHE3DMOBSGQZ2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/BCZDYVUUQ3J52HMHIOUWZFT45Z5JDA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINJZHE3DMOBSGQZ2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
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.
Description
Adds a
NoImprovementHandlerthat stops training when metrics stop improving for a set number of epochs. This is a simpler alternative to the existingEarlyStoppinghandler.Key Features
patience,score_function,trainer, and optionalmodeparameter'max', default) and minimization ('min') objectivesstate_dict()andload_state_dict()for checkpointingreset()method for reuse across training runsattach()method for easy integration with ignite enginesChanges
ignite/handlers/no_improvement_handler.pyignite/handlers/__init__.pyto exportNoImprovementHandlerCloses #2314