Skip to content

Commit 82e8677

Browse files
committed
Make LaProp weight decay match typical PyTorch 'decoupled' behaviour where it's scaled by LR
1 parent 886eb77 commit 82e8677

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

timm/optim/laprop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@ def step(self, closure=None):
116116
p.add_(exp_avg, alpha=-step_size)
117117

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

121121
return loss

0 commit comments

Comments
 (0)