Skip to content

Commit

Permalink
Make LaProp weight decay match typical PyTorch 'decoupled' behaviour …
Browse files Browse the repository at this point in the history
…where it's scaled by LR
  • Loading branch information
rwightman committed Nov 30, 2024
1 parent 886eb77 commit 82e8677
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion timm/optim/laprop.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ def step(self, closure=None):
p.add_(exp_avg, alpha=-step_size)

if group['weight_decay'] != 0:
p.add_(p, alpha=-group['weight_decay'])
p.add_(p, alpha=-(group['lr'] * group['weight_decay']))

return loss

0 comments on commit 82e8677

Please sign in to comment.