Skip to content

Commit

Permalink
Merge pull request #227 from i404788/main
Browse files Browse the repository at this point in the history
[Bugfix] Fix SRMM to allow operation beyond memory_length
  • Loading branch information
kozistr authored Apr 7, 2024
2 parents da65344 + b0124e0 commit 523f140
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch_optimizer/optimizer/srmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def step(self, closure: CLOSURE = None) -> LOSS:
group['step'] = 1

w_t: float = (
(group['step'] + 1) % (group['memory_length'] if group['memory_length'] is not None else 1)
(group['step'] % (group['memory_length'] if group['memory_length'] is not None else 1)) + 1
) ** -group['beta']

for p in group['params']:
Expand Down

0 comments on commit 523f140

Please sign in to comment.