Commit ff8e4281 authored by Vít Novotný's avatar Vít Novotný
Browse files

Increase early stopping patience for training NER models

parent 832adbaa
Pipeline #146507 passed with stage
in 8 minutes and 38 seconds
......@@ -99,6 +99,7 @@ save_every_n_steps = 1000
number_of_validation_samples = 1000
number_of_training_epochs = 10
schedule = fair-sequential-schedule
stopping_patience = 100
[recognition.FairSequentialSchedule]
maximum_number_of_training_epochs_per_objective = 1
......
......@@ -34,6 +34,7 @@ class NerModel:
NUM_TRAIN_EPOCHS = CONFIG.getint('number_of_training_epochs')
SCHEDULE_NAME = CONFIG['schedule']
NUM_VALIDATION_SAMPLES = CONFIG.getint('number_of_validation_samples')
STOPPING_PATIENCE = CONFIG.getint('stopping_patience')
def __init__(self, model: AutoModelForTokenClassification):
self.model = model
......@@ -89,6 +90,7 @@ class NerModel:
stopping_strategy=StoppingStrategy.FIRST_OBJECTIVE_CONVERGED,
evaluation_strategy='steps',
eval_steps=cls.EVAL_STEPS,
stopping_patience=cls.STOPPING_PATIENCE,
save_strategy='steps',
save_steps=cls.SAVE_STEPS,
logging_strategy='steps',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment