MCPcopy
hub / github.com/tinygrad/tinygrad / get_lr

Method get_lr

extra/lr_scheduler.py:67–69  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

65 self.eta_max = optimizer.lr.numpy()[0]
66
67 def get_lr(self) -> Tensor:
68 lr = self.eta_min + 0.5 * (self.eta_max - self.eta_min) * (1 + math.cos((self.epoch_counter.numpy()[0]/self.T_max) * math.pi))
69 return Tensor([lr], device=self.optimizer.device, dtype=self.optimizer.lr.dtype)
70
71class OneCycleLR(LR_Scheduler):
72 def __init__(self, optimizer: Optimizer, max_lr: float, div_factor: float, final_div_factor: float, total_steps: int, pct_start: float,

Callers

nothing calls this directly

Calls 3

TensorClass · 0.90
cosMethod · 0.80
numpyMethod · 0.45

Tested by

no test coverage detected