MCPcopy Create free account
hub / github.com/GanjinZero/BioBART / warmup_linear_decay_linear

Function warmup_linear_decay_linear

pretrain_src/optimization_utils.py:67–75  ·  view source on GitHub ↗
(global_step,
                          total_steps,
                          warmup=0.002,
                          )

Source from the content-addressed store, hash-verified

65 return (1.0 - x)**degree
66
67def warmup_linear_decay_linear(global_step,
68 total_steps,
69 warmup=0.002,
70 ):
71 x = global_step / total_steps # x is the propotion of the updated steps wrt total steps
72 if x < warmup:
73 return x / warmup
74 else:
75 return 1.0 - (x - warmup)/(1.0 - warmup)

Callers 2

load_checkpointFunction · 0.90
update_learning_rateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected