File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
pytorch_optimizer/optimizer Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,8 @@ def step(self, closure: CLOSURE = None) -> LOSS:
245245 bias_correction1 = 1.0 - beta1 ** step # fmt: skip
246246 bias_correction2_sq = math .sqrt (1.0 - beta2 ** step ) # fmt: skip
247247
248+ noise_norm : float = math .sqrt ((1.0 + beta2 ) ** 2 + beta2 ** 2 ) # fmt: skip
249+
248250 # warm up
249251 lr = self .warm_up_dampening (lr , step )
250252
@@ -292,7 +294,6 @@ def step(self, closure: CLOSURE = None) -> LOSS:
292294 if self .use_softplus :
293295 de_nom = F .softplus (de_nom , beta = self .beta_softplus )
294296
295- noise_norm : float = math .sqrt ((1.0 + beta2 ) ** 2 + beta2 ** 2 ) # fmt: skip
296297 pn_momentum = grad_ma .mul (1.0 + 1.0 ).add (neg_grad_ma , alpha = - 1.0 ).mul (1.0 / noise_norm )
297298 p .addcdiv_ (pn_momentum , de_nom , value = - step_size )
298299
You can’t perform that action at this time.
0 commit comments