Skip to content

Commit

Permalink
Fix final value of exponential decay lr
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-Anthony committed Sep 23, 2023
1 parent 390d37c commit 1f832c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion megatron/learning_rates.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def get_lr(self):
)
elif self.decay_style == "exponential":
# exp(-0.693) = 1/2
lr = self.start_lr * math.exp(-0.693 * num_iters_ / self.end_iter)
end_iter = self.end_iter - self.warmup_iter
lr = self.start_lr * math.exp(-0.693 * num_iters_ / end_iter)
else:
lr = self.start_lr
return max(lr, self.min_lr)
Expand Down

0 comments on commit 1f832c1

Please sign in to comment.