Commit a179b7fe authored by A. Unique TensorFlower's avatar A. Unique TensorFlower
Browse files

Merge pull request #8436 from ayushmankumar7:name

PiperOrigin-RevId: 308469410
parents 2c6f12e3 81ac90c1
...@@ -76,10 +76,7 @@ class PiecewiseConstantDecayWithWarmup( ...@@ -76,10 +76,7 @@ class PiecewiseConstantDecayWithWarmup(
def _get_learning_rate(self, step): def _get_learning_rate(self, step):
"""Compute learning rate at given step.""" """Compute learning rate at given step."""
with tf.compat.v1.name_scope(self.name, 'PiecewiseConstantDecayWithWarmup', with tf.name_scope('PiecewiseConstantDecayWithWarmup'):
[self.rescaled_lr, self.step_boundaries,
self.lr_values, self.warmup_steps,
self.compute_lr_on_cpu]):
def warmup_lr(step): def warmup_lr(step):
return self.rescaled_lr * ( return self.rescaled_lr * (
tf.cast(step, tf.float32) / tf.cast(self.warmup_steps, tf.float32)) tf.cast(step, tf.float32) / tf.cast(self.warmup_steps, tf.float32))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment