Skip to content

Commit

Permalink
Cosine schedule fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
bghira committed Oct 31, 2023
1 parent 2a45762 commit 558f6b7
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions helpers/training/custom_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,6 @@ def step(self, epoch=None):
self.T_cur = epoch
self.last_epoch = epoch

with _enable_get_lr_call(self):
for i, data in enumerate(zip(self.optimizer.param_groups, self.get_lr())):
param_group, lr = data
param_group['lr'] = lr
self.print_lr(self.verbose, i, lr, epoch)

self._last_lr = [group['lr'] for group in self.optimizer.param_groups]

class _enable_get_lr_call:
def __init__(self, o):
self.o = o
Expand All @@ -233,7 +225,7 @@ def __exit__(self, type, value, traceback):
with _enable_get_lr_call(self):
for i, data in enumerate(zip(self.optimizer.param_groups, self.get_lr())):
param_group, lr = data
param_group["lr"] = lr
param_group['lr'] = lr
self.print_lr(self.verbose, i, lr, epoch)

self._last_lr = [group["lr"] for group in self.optimizer.param_groups]
self._last_lr = [group['lr'] for group in self.optimizer.param_groups]

0 comments on commit 558f6b7

Please sign in to comment.