Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
ananyahjha93 committed Aug 5, 2020
2 parents 92bd7e2 + f9056bd commit 5767519
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pl_bolts/optimizers/lr_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,11 @@ def get_lr(self) -> List[float]:
) / 2 for base_lr, group in zip(self.base_lrs, self.optimizer.param_groups)
]

return [
(1 + math.cos(
return [(1 + math.cos(
math.pi * (self.last_epoch - self.warmup_epochs) / (self.max_epochs - self.warmup_epochs)
)) / (1 + math.cos(
math.pi * (self.last_epoch - self.warmup_epochs - 1) / (self.max_epochs - self.warmup_epochs)
)) * (group["lr"] - self.eta_min) + self.eta_min for group in self.optimizer.param_groups
)) / (1 + math.cos(math.pi * (self.last_epoch - self.warmup_epochs - 1) / (
self.max_epochs - self.warmup_epochs
))) * (group["lr"] - self.eta_min) + self.eta_min for group in self.optimizer.param_groups
]

def _get_closed_form_lr(self) -> List[float]:
Expand Down

0 comments on commit 5767519

Please sign in to comment.