Skip to content

Commit fbc09cc

Browse files
committed
update: add eps to exp_avg_sq_hat_mean
1 parent 0464b21 commit fbc09cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_optimizer/optimizer/adams.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def step(self, closure: CLOSURE = None) -> LOSS:
118118
if param_size == 0:
119119
raise ZeroParameterSizeError()
120120

121-
exp_avg_sq_hat_mean = math.sqrt(exp_avg_sq_hat_sum / param_size)
121+
exp_avg_sq_hat_mean = math.sqrt(exp_avg_sq_hat_sum / param_size) + self.eps
122122

123123
for group in self.param_groups:
124124
beta1, beta2 = group['betas']

0 commit comments

Comments
 (0)