Skip to content

Commit 37524ed

Browse files
committed
update: MADGRAD optimizer
1 parent ffeb153 commit 37524ed

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

pytorch_optimizer/optimizer/madgrad.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,9 @@ def step(self, closure: CLOSURE = None) -> LOSS:
116116
grad_sum_sq_masked = grad_sum_sq.sparse_mask(grad)
117117
s_masked = s.sparse_mask(grad)
118118

119-
# Compute x_0 from other known quantities
120119
rms_masked_values = grad_sum_sq_masked._values().pow(1 / 3).add_(eps)
121120
x0_masked_values = p_masked._values().addcdiv(s_masked._values(), rms_masked_values, value=1)
122121

123-
# Dense + sparse op
124122
grad_sq = grad * grad
125123
grad_sum_sq.add_(grad_sq, alpha=_lambda)
126124
grad_sum_sq_masked.add_(grad_sq, alpha=_lambda)

0 commit comments

Comments
 (0)