-
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! |
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
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
: