remove self.lr_epsilon, improve logging
@@ -874,7 +874,6 @@ class ReduceLROnPlateau(Callback):
self.best = -np.Inf
self.cooldown_counter = 0
self.wait = 0
- self.lr_epsilon = self.min_lr * 1e-4
def on_train_begin(self, logs=None):
self._reset()
@@ -901,12 +900,13 @@ class ReduceLROnPlateau(Callback):
elif not self.in_cooldown():
if self.wait >= self.patience:
old_lr = float(K.get_value(self.model.optimizer.lr))
- if old_lr > self.min_lr + self.lr_epsilon:
+ if old_lr > self.min_lr:
new_lr = old_lr * self.factor
new_lr = max(new_lr, self.min_lr)
K.set_value(self.model.optimizer.lr, new_lr)
if self.verbose > 0:
- print('\nEpoch %05d: reducing learning rate to %s.' % (epoch + 1, new_lr))
+ print('\nEpoch %05d: ReduceLROnPlateau reducing learning '
+ 'rate to %s.' % (epoch + 1, new_lr))
self.cooldown_counter = self.cooldown
self.wait = 0
self.wait += 1
