MCPcopy Create free account
hub / github.com/geekcomputers/Python / get_lr

Method get_lr

ML/src/python/neuralforge/optim/schedulers.py:11–18  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

9 super().__init__(optimizer, last_epoch)
10
11 def get_lr(self):
12 if self.last_epoch < self.warmup_epochs:
13 return [base_lr * (self.last_epoch + 1) / self.warmup_epochs for base_lr in self.base_lrs]
14
15 if self.base_scheduler is not None:
16 return self.base_scheduler.get_last_lr()
17
18 return self.base_lrs
19
20 def step(self, epoch=None):
21 if self.last_epoch < self.warmup_epochs:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected