MCPcopy Create free account
hub / github.com/Tencent/digitalhuman / lr_lambda

Function lr_lambda

RLVER/code/verl/utils/torch_functional.py:464–469  ·  view source on GitHub ↗
(current_step)

Source from the content-addressed store, hash-verified

462 intercept = (1 + min_lr_ratio) * 0.5
463
464 def lr_lambda(current_step):
465 if current_step < num_warmup_steps:
466 return float(current_step) / float(max(1, num_warmup_steps))
467 progress = float(current_step - num_warmup_steps) / float(max(1, num_training_steps - num_warmup_steps))
468 x = math.cos(math.pi * float(num_cycles) * 2.0 * progress)
469 return max(0.0, x * coef + intercept)
470
471 return LambdaLR(optimizer, lr_lambda, last_epoch)
472

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected