OpenNMT Forum

Is `early-stopping` available feature in OpenNMT-tf or OpenNMT-py?

I am currently using OpenNMT-tf for machine translation task, but I can’t find any parameter regarding to validation or early-stopping.

Is there one for it in OpenNMT-py?

Thanks in advance!

See features availability here:

http://opennmt.net/features/

and OpenNMT-py related options here:

http://opennmt.net/OpenNMT-py/options/train.html#Optimization-%20Type

P.S.: No need to post the question everywhere, you won’t get different answers.

You can find the early_stop options in training script~

group.add('--early_stopping', '-early_stopping', type=int, default=0,
              help='Number of validation steps without improving.')
group.add('--early_stopping_criteria', '-early_stopping_criteria',
              nargs="*", default=None,
              help='Criteria to use for early stopping.')```

Only OpenNMT Pytorch support early stopping

Hi byuns9334,
I implemented early stopping for Openmt_tf. It is available in my forked repository: https://github.com/Sasanita/OpenNMT-tf
It is based on loss function. Let me know if it works properly (any suggestion is welcome). In your config file please include early_stopping: steps_number in eval section.

Example:
eval:
batch_size: 64
eval_delay: 900
exporters: last
external_evaluators: BLEU
early_stopping: 1500

Regards

1 Like

Great, thanks @Sasanita!

For reference, early stopping will be available in OpenNMT-tf 2.0. It will work on any evaluation metric, including BLEU.

1 Like

@Sasanita i will check it out soon!