Skip to content

Commit

Permalink
Update llmfoundry/optim/scheduler.py
Browse files Browse the repository at this point in the history
Co-authored-by: Brian <[email protected]>
  • Loading branch information
codestar12 and b-chu committed Oct 10, 2023
1 parent 70cbef2 commit 7a17279
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llmfoundry/optim/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def __call__(self, state: State, ssr: float = 1.0) -> float:
t_cooldown_start = t_warmup

if state.timestamp < t_cooldown_start:
# rescale LR by a coeff equal to the inverse square root of the time
# Rescale LR by a coefficient equal to the inverse square root of the time
# elapsed after warmup, rescaled by the time scale, such that, at
# infinite time, the LR decays to alpha_f_decay
# infinite time, the LR decays to alpha_f_decay.
coeff = 1 / ((current_time + t_shift) / t_scale).value**0.5
current_factor = (self.alpha_f_decay + coeff *
(1.0 - self.alpha_f_decay))
Expand Down

0 comments on commit 7a17279

Please sign in to comment.