Skip to content

Commit

Permalink
fix lars
Browse files Browse the repository at this point in the history
  • Loading branch information
Mi-Peng committed Jan 19, 2022
1 parent 2d4b7e7 commit cdcd0a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion timm/optim/lars.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def step(self, closure=None):
)
if group['trust_clip']:
trust_ratio = torch.minimum(trust_ratio / group['lr'], one_tensor)
grad.add(p, alpha=weight_decay)
grad.add_(p, alpha=weight_decay)
grad.mul_(trust_ratio)

# apply SGD update https://github.com/pytorch/pytorch/blob/1.7/torch/optim/sgd.py#L100
Expand Down

0 comments on commit cdcd0a9

Please sign in to comment.