MCPcopy Create free account
hub / github.com/OpenMeshLab/MeshXL / compute_learning_rate

Function compute_learning_rate

engine.py:10–20  ·  view source on GitHub ↗
(args, curr_iter, max_iters)

Source from the content-addressed store, hash-verified

8
9
10def compute_learning_rate(args, curr_iter, max_iters):
11 assert curr_iter <= max_iters and curr_iter >= 0
12 if (curr_iter <= args.warm_lr_iters) and args.warm_lr_iters > 0:
13 # Linear Warmup: warm_lr -> curr_lr -> base_lr
14 curr_lr = args.warm_lr + curr_iter / args.warm_lr_iters * (args.base_lr - args.warm_lr)
15 else:
16 # Cosine Learning Rate Schedule
17 curr_lr = args.final_lr + 0.5 * (args.base_lr - args.final_lr) * (
18 1 + math.cos(math.pi * curr_iter / max_iters)
19 )
20 return curr_lr
21
22
23

Callers 1

adjust_learning_rateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected