MCPcopy Create free account
hub / github.com/Kitware/COAT / f

Function f

utils/utils.py:407–411  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

405
406def 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected