MCPcopy Create free account
hub / github.com/OpenImagingLab/4DSloMo / helper

Function helper

utils/general_utils.py:48–61  ·  view source on GitHub ↗
(step)

Source from the content-addressed store, hash-verified

46 """
47
48 def helper(step):
49 if step < 0 or (lr_init == 0.0 and lr_final == 0.0):
50 # Disable this parameter
51 return 0.0
52 if lr_delay_steps > 0:
53 # A kind of reverse cosine decay.
54 delay_rate = lr_delay_mult + (1 - lr_delay_mult) * np.sin(
55 0.5 * np.pi * np.clip(step / lr_delay_steps, 0, 1)
56 )
57 else:
58 delay_rate = 1.0
59 t = np.clip(step / max_steps, 0, 1)
60 log_lerp = np.exp(np.log(lr_init) * (1 - t) + np.log(lr_final) * t)
61 return delay_rate * log_lerp
62
63 return helper
64

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected