Skip to content

Commit

Permalink
Fix weight decay comment (#4228)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Jul 29, 2021
1 parent 1a10b0e commit 8d3c3ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
for v in model.modules():
if hasattr(v, 'bias') and isinstance(v.bias, nn.Parameter): # bias
g2.append(v.bias)
if isinstance(v, nn.BatchNorm2d): # weight with decay
if isinstance(v, nn.BatchNorm2d): # weight (no decay)
g0.append(v.weight)
elif hasattr(v, 'weight') and isinstance(v.weight, nn.Parameter): # weight without decay
elif hasattr(v, 'weight') and isinstance(v.weight, nn.Parameter): # weight (with decay)
g1.append(v.weight)

if opt.adam:
Expand Down

0 comments on commit 8d3c3ef

Please sign in to comment.