MCPcopy Create free account
hub / github.com/allenai/OLMoASR / lr_lambda

Function lr_lambda

scripts/training/train_timestamps.py:772–779  ·  view source on GitHub ↗
(global_step: int)

Source from the content-addressed store, hash-verified

770 warmup_steps = np.ceil(0.002 * train_steps)
771
772 def lr_lambda(global_step: int) -> float:
773 if global_step < warmup_steps:
774 return float(global_step) / float(max(1, warmup_steps))
775 return max(
776 0.0,
777 float(train_steps - global_step)
778 / float(max(1, train_steps - warmup_steps)),
779 )
780
781 scheduler = LambdaLR(optimizer=optimizer, lr_lambda=lr_lambda)
782

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected