MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / step

Method step

codegeex/megatron/learning_rates.py:116–125  ·  view source on GitHub ↗

Set lr for all parameters groups.

(self, increment, token_num=None)

Source from the content-addressed store, hash-verified

114 return self.min_lr + coeff * delta_lr
115
116 def step(self, increment, token_num=None):
117 """Set lr for all parameters groups."""
118 if token_num is None:
119 args = get_args()
120 token_num = args.consumed_train_tokens
121 self.num_tokens = token_num
122 self.num_steps += increment
123 new_lr = self.get_lr()
124 for group in self.optimizer.param_groups:
125 group["lr"] = new_lr
126
127 def state_dict(self):
128 state_dict = {

Callers 3

__init__Method · 0.95
load_state_dictMethod · 0.95
train_stepFunction · 0.45

Calls 2

get_lrMethod · 0.95
get_argsFunction · 0.90

Tested by

no test coverage detected