MCPcopy Index your code
hub / github.com/THUDM/GLM / main

Function main

test/test_rel_shift.py:20–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19
20def main():
21 model = Linear(10, 10)
22 optimizer = Adam(model.parameters())
23 lr_scheduler = AnnealingLR(optimizer,
24 start_lr=0.00015,
25 warmup_iter=3000,
26 num_iters=300000,
27 decay_style='cosine',
28 decay_ratio=0.1)
29 steps = np.arange(0, 400000, 10, dtype=np.long)
30 rates = []
31 for step in steps:
32 lr_scheduler.num_iters = step
33 rates.append(lr_scheduler.get_lr())
34 print(rates)
35 plt.plot(steps, rates)
36 plt.savefig("lr.pdf", format='pdf')

Callers 1

run_test.pyFile · 0.90

Calls 3

get_lrMethod · 0.95
AnnealingLRClass · 0.90
appendMethod · 0.80

Tested by

no test coverage detected