From c10f7f1ad669277e7f0424cc7c09e12a4473b5b6 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 31 Aug 2020 12:57:48 +0200 Subject: [PATCH] Refactor rlrop condition. --- training/deepspeech_training/train.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/training/deepspeech_training/train.py b/training/deepspeech_training/train.py index e8adb119..5d4d7a0d 100644 --- a/training/deepspeech_training/train.py +++ b/training/deepspeech_training/train.py @@ -642,9 +642,11 @@ def train(): # Reduce learning rate on plateau # If the learning rate was reduced and there is still no improvement # wait FLAGS.plateau_epochs before the learning rate is reduced again - if (FLAGS.reduce_lr_on_plateau and - epochs_without_improvement % FLAGS.plateau_epochs == 0 and epochs_without_improvement > 0): - + if ( + FLAGS.reduce_lr_on_plateau + and epochs_without_improvement > 0 + and epochs_without_improvement % FLAGS.plateau_epochs == 0 + ): # Reload checkpoint that we use the best_dev weights again reload_best_checkpoint(session)