MCPcopy Create free account
hub / github.com/AlmondGod/tinyworlds / _split_decay_params

Function _split_decay_params

utils/optimizer_utils.py:72–81  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

70
71
72def _split_decay_params(model):
73 decay = []
74 no_decay = []
75 for name, param in model.named_parameters():
76 if param.requires_grad:
77 if len(param.shape) == 1 or name.endswith(".bias") or "norm" in name:
78 no_decay.append(param)
79 else:
80 decay.append(param)
81 return decay, no_decay

Callers 1

_create_adamwFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected