From 3aa2b56edab79669e2b74826ba8b7391135ee014 Mon Sep 17 00:00:00 2001 From: iperov Date: Thu, 30 Sep 2021 00:40:59 +0400 Subject: [PATCH] fix --- core/leras/optimizers/AdaBelief.py | 2 +- core/leras/optimizers/RMSprop.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/leras/optimizers/AdaBelief.py b/core/leras/optimizers/AdaBelief.py index b283624..da6e1a2 100644 --- a/core/leras/optimizers/AdaBelief.py +++ b/core/leras/optimizers/AdaBelief.py @@ -67,7 +67,7 @@ class AdaBelief(nn.OptimizerBase): if self.lr_cos != 0: lr *= (tf.cos( tf.cast(self.iterations, g.dtype) * (2*3.1415926535/ float(self.lr_cos) ) ) + 1.0) / 2.0 - v_diff = - lr * m_t / (tf.sqrt(v_t) + np.finfo( m_t.dtype.as_numpy_dtype ).resolution ) + v_diff = - lr * m_t / (tf.sqrt(v_t) + np.finfo( g.dtype.as_numpy_dtype ).resolution ) if self.lr_dropout != 1.0: lr_rnd = self.lr_rnds_dict[v.name] v_diff *= lr_rnd diff --git a/core/leras/optimizers/RMSprop.py b/core/leras/optimizers/RMSprop.py index 2c2ab30..bf26f52 100644 --- a/core/leras/optimizers/RMSprop.py +++ b/core/leras/optimizers/RMSprop.py @@ -59,7 +59,7 @@ class RMSprop(nn.OptimizerBase): lr = tf.constant(self.lr, g.dtype) - v_diff = - lr * g / (tf.sqrt(new_a) + np.finfo( m_t.dtype.as_numpy_dtype ).resolution ) + v_diff = - lr * g / (tf.sqrt(new_a) + np.finfo( g.dtype.as_numpy_dtype ).resolution ) if self.lr_dropout != 1.0: lr_rnd = self.lr_rnds_dict[v.name] v_diff *= lr_rnd