From a71a0f865b5723017e8cb147deee2bae321f878f Mon Sep 17 00:00:00 2001 From: minqiyang Date: Wed, 27 Mar 2019 16:03:10 +0800 Subject: [PATCH] Polish code test=develop --- python/paddle/fluid/imperative/learning_rate_scheduler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/imperative/learning_rate_scheduler.py b/python/paddle/fluid/imperative/learning_rate_scheduler.py index 0ace448d7f8..b698e620073 100644 --- a/python/paddle/fluid/imperative/learning_rate_scheduler.py +++ b/python/paddle/fluid/imperative/learning_rate_scheduler.py @@ -220,7 +220,7 @@ class NoamDecay(LearningRateDecay): def step(self): from .. import layers - a = self.create_lr_var(global_step**-0.5) - b = self.create_lr_var((warmup_steps**-1.5) * global_step) - lr_value = (d_model**-0.5) * layers.elementwise_min(a, b) + a = self.create_lr_var(self.step_num**-0.5) + b = self.create_lr_var((self.warmup_steps**-1.5) * self.step_num) + lr_value = (self.d_model**-0.5) * layers.elementwise_min(a, b) return lr_value -- GitLab