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

Method __init__

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

Source from the content-addressed store, hash-verified

126 """
127
128 def __init__(self, optimizer, warmup_period, last_step=-1):
129 _check_optimizer(optimizer)
130 group_count = len(optimizer.param_groups)
131 warmup_params = get_warmup_params(warmup_period, group_count)
132 super(ExponentialWarmup, self).__init__(optimizer, warmup_params, last_step)
133
134 def warmup_factor(self, step, warmup_period):
135 return 1.0 - math.exp(-(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