MCPcopy Create free account
hub / github.com/huggingface/transformers / lr_lambda

Function lr_lambda

src/transformers/optimization.py:39–42  ·  view source on GitHub ↗
(current_step)

Source from the content-addressed store, hash-verified

37 """
38
39 def lr_lambda(current_step):
40 if current_step < num_warmup_steps:
41 return float(current_step) / float(max(1.0, num_warmup_steps))
42 return 1.0
43
44 return LambdaLR(optimizer, lr_lambda, last_epoch=last_epoch)
45

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected