(x)
| 405 | |
| 406 | def warmup_lr_scheduler(optimizer, warmup_iters, warmup_factor): |
| 407 | def f(x): |
| 408 | if x >= warmup_iters: |
| 409 | return 1 |
| 410 | alpha = float(x) / warmup_iters |
| 411 | return warmup_factor * (1 - alpha) + alpha |
| 412 | |
| 413 | return torch.optim.lr_scheduler.LambdaLR(optimizer, f) |
| 414 |
nothing calls this directly
no outgoing calls
no test coverage detected