Repository navigation
|
Dear MONAI team, I saw in MONAI there is an Early Stop Handler which acts as an Ignite handler (monai.handlers.EarlyStopHandler) Thank you in advance! |
Answered by
Nic-Ma
Apr 11, 2022
Replies: 2 comments 23 replies
|
Hi @HripsimeS, is it possible to keep a copy of the associated code within the discussion threads? I suspect in that way our discussions can potentially benefit more users who arrive here via the search engines. |
0 replies
|
Hi @HripsimeS , Here are 2 simple examples for the usage of EarlyStopping handler:
handler = EarlyStopHandler(
trainer=trainer,
patience=100,
score_function=lambda x: -x.state.output['loss'],
epoch_level=False,
)
handler = EarlyStopHandler(
trainer=trainer,
patience=1,
score_function=lambda x: x.state.metrics['val_mean_dice'],
)Thanks. |
23 replies
Answer selected by
HripsimeS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Hi @HripsimeS ,
Here are 2 simple examples for the usage of EarlyStopping handler:
To use loss value to execute EarlyStop, attach the handler to
trainer, added “-” negative value because smaller loss is better:evaluator: