MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / __init__

Method __init__

schedulers/pytorch_warmup/base.py:109–113  ·  view source on GitHub ↗
(self, optimizer, warmup_period, last_step=-1)

Source from the content-addressed store, hash-verified

107 """
108
109 def __init__(self, optimizer, warmup_period, last_step=-1):
110 _check_optimizer(optimizer)
111 group_count = len(optimizer.param_groups)
112 warmup_params = get_warmup_params(warmup_period, group_count)
113 super(LinearWarmup, self).__init__(optimizer, warmup_params, last_step)
114
115 def warmup_factor(self, step, warmup_period):
116 return min(1.0, (step+1) / warmup_period)

Callers

nothing calls this directly

Calls 3

_check_optimizerFunction · 0.85
get_warmup_paramsFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected