Skip to content

Commit

Permalink
update the end value of warmup
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebookresearch#4932

When `rescale_interval` is True, the end value of warmup should be the init lr (`schelduer(0.0)`) instead of `scheduler(warmup_length)`

Reviewed By: tglik

Differential Revision: D44323253

fbshipit-source-id: 8a5b1cdee4184dbdb999632ca090d0fd5073e2cb
  • Loading branch information
Xiaofang Wang authored and facebook-github-bot committed May 18, 2023
1 parent d4a5f28 commit 2c6c380
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion detectron2/solver/lr_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def __init__(
rescale_interval: whether we will rescale the interval of the scheduler after
warmup
"""
end_value = scheduler(warmup_length) # the value to reach when warmup ends
# the value to reach when warmup ends
end_value = scheduler(0.0) if rescale_interval else scheduler(warmup_length)
start_value = warmup_factor * scheduler(0.0)
if warmup_method == "constant":
warmup = ConstantParamScheduler(start_value)
Expand Down

0 comments on commit 2c6c380

Please sign in to comment.