← Walkthroughsrc/speech_decoding/experiments/lr_schedule.py
Selected training excerpt · lines 81–95 · source SHA-256 a3170db42088
81 return 1.0 - progress # linear8283 def _multiplier(self, step: int) -> float:84 if self.warmup_steps > 0 and step < self.warmup_steps:85 return min(1.0, (step + 1) / self.warmup_steps)86 if step < self.stable_steps:87 return 1.088 decay_total = max(1, self.total_steps - self.stable_steps)89 progress = min(1.0, max(0.0, (step - self.stable_steps) / decay_total))90 shaped = self._decay(progress)91 return self.min_lr_ratio + (1.0 - self.min_lr_ratio) * shaped9293 def get_lr(self) -> list[float]: # type: ignore[override]94 mult = self._multiplier(self.last_epoch)95 return [base_lr * mult for base_lr in self.base_lrs]