(current_step)
| 411 | intercept = (1 + min_lr_ratio) * 0.5 |
| 412 | |
| 413 | def lr_lambda(current_step): |
| 414 | if current_step < num_warmup_steps: |
| 415 | return float(current_step) / float(max(1, num_warmup_steps)) |
| 416 | progress = float(current_step - num_warmup_steps) / float(max(1, num_training_steps - num_warmup_steps)) |
| 417 | x = math.cos(math.pi * float(num_cycles) * 2.0 * progress) |
| 418 | return max(0.0, x * coef + intercept) |
| 419 | |
| 420 | return LambdaLR(optimizer, lr_lambda, last_epoch) |
| 421 |
nothing calls this directly
no outgoing calls
no test coverage detected