In my Seq2SeqTrainer
, I use EarlyStoppingCallback
to stop the training process when the criteria has been met.
trainer = Seq2SeqTrainer(
model = model,
args = training_args,
train_dataset = train_set,
eval_dataset = eval_set,
tokenizer = tokenizer,
data_collator = data_collator,
compute_metrics = compute_metrics,
callbacks = [EarlyStoppingCallback(early_stopping_patience=1)]
)
Currently, I am using the default value 1
in the early_stopping_patience
, but how can I determine which value I should use? The official documentation doesn't say much.
early_stopping_patience (int) — Use with
metric_for_best_model
to stop training when the specified metric worsens forearly_stopping_patience
evaluation calls.
Also, could I use Epoch instead of Step in evaluation_strategy
with this EarlyStoppingCallback()
?
Thanks in advance.