fix
This commit is contained in:
1 parent
c6d0c547b7
commit
3aa2b56eda
2 files changed
+2
-2
No files matched your search
@@ -67,7 +67,7 @@ class AdaBelief(nn.OptimizerBase):
|
|||||||
if self.lr_cos != 0:
|
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
|
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:
|
if self.lr_dropout != 1.0:
|
||||||
lr_rnd = self.lr_rnds_dict[v.name]
|
lr_rnd = self.lr_rnds_dict[v.name]
|
||||||
v_diff *= lr_rnd
|
v_diff *= lr_rnd
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class RMSprop(nn.OptimizerBase):
|
|||||||
|
|
||||||
lr = tf.constant(self.lr, g.dtype)
|
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:
|
if self.lr_dropout != 1.0:
|
||||||
lr_rnd = self.lr_rnds_dict[v.name]
|
lr_rnd = self.lr_rnds_dict[v.name]
|
||||||
v_diff *= lr_rnd
|
v_diff *= lr_rnd
|
||||||
|
|||||||
Reference in new issue
Block a user