MCPcopy Create free account
hub / github.com/YeWR/EfficientZero / adjust_lr

Function adjust_lr

core/train.py:30–41  ·  view source on GitHub ↗
(config, optimizer, step_count)

Source from the content-addressed store, hash-verified

28
29
30def adjust_lr(config, optimizer, step_count):
31 # adjust learning rate, step lr every lr_decay_steps
32 if step_count < config.lr_warm_step:
33 lr = config.lr_init * step_count / config.lr_warm_step
34 for param_group in optimizer.param_groups:
35 param_group['lr'] = lr
36 else:
37 lr = config.lr_init * config.lr_decay_rate ** ((step_count - config.lr_warm_step) // config.lr_decay_steps)
38 for param_group in optimizer.param_groups:
39 param_group['lr'] = lr
40
41 return lr
42
43
44def update_weights(model, batch, optimizer, replay_buffer, config, scaler, vis_result=False):

Callers 1

_trainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected