mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Make LaProp weight decay match typical PyTorch 'decoupled' behaviour where it's scaled by LR
This commit is contained in:
parent
886eb77938
commit
82e8677690
@ -116,6 +116,6 @@ class LaProp(Optimizer):
|
|||||||
p.add_(exp_avg, alpha=-step_size)
|
p.add_(exp_avg, alpha=-step_size)
|
||||||
|
|
||||||
if group['weight_decay'] != 0:
|
if group['weight_decay'] != 0:
|
||||||
p.add_(p, alpha=-group['weight_decay'])
|
p.add_(p, alpha=-(group['lr'] * group['weight_decay']))
|
||||||
|
|
||||||
return loss
|
return loss
|
Loading…
x
Reference in New Issue
Block a user