Unverified Commit 831bc25d authored by David Valente's avatar David Valente Committed by GitHub
Browse files

Correct zero division error in inverse sqrt scheduler (#28982)

* Correct zero division error in inverse sqrt scheduler

* default timescale to 10_000
parent 1a7c117d
...@@ -317,7 +317,7 @@ def get_inverse_sqrt_schedule( ...@@ -317,7 +317,7 @@ def get_inverse_sqrt_schedule(
# https://github.com/google-research/big_vision/blob/f071ce68852d56099437004fd70057597a95f6ef/big_vision/utils.py#L930 # https://github.com/google-research/big_vision/blob/f071ce68852d56099437004fd70057597a95f6ef/big_vision/utils.py#L930
if timescale is None: if timescale is None:
timescale = num_warmup_steps timescale = num_warmup_steps or 10_000
lr_lambda = partial(_get_inverse_sqrt_schedule_lr_lambda, num_warmup_steps=num_warmup_steps, timescale=timescale) lr_lambda = partial(_get_inverse_sqrt_schedule_lr_lambda, num_warmup_steps=num_warmup_steps, timescale=timescale)
return LambdaLR(optimizer, lr_lambda, last_epoch=last_epoch) return LambdaLR(optimizer, lr_lambda, last_epoch=last_epoch)
......
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