Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reformat
Browse files Browse the repository at this point in the history
‘whl’ committed Apr 6, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent dd29c6c commit a9149c8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ding/torch_utils/lr_scheduler.py
Original file line number Diff line number Diff line change
@@ -19,9 +19,13 @@ def get_lr_ratio(epoch: int, warmup_epochs: int, learning_rate: float, lr_decay_
return (min_lr + coefficient * (learning_rate - min_lr)) / learning_rate


def cos_lr_scheduler(optimizer: torch.optim.Optimizer,
learning_rate: float, warmup_epochs: float = 5, lr_decay_epochs: float = 100,
min_lr: float = 6e-5) -> torch.optim.lr_scheduler.LambdaLR:
def cos_lr_scheduler(
optimizer: torch.optim.Optimizer,
learning_rate: float,
warmup_epochs: float = 5,
lr_decay_epochs: float = 100,
min_lr: float = 6e-5
) -> torch.optim.lr_scheduler.LambdaLR:
return LambdaLR(
optimizer,
partial(

0 comments on commit a9149c8

Please sign in to comment.