glenn-jocher commited on
Commit
8d3c3ef
1 Parent(s): 1a10b0e

Fix weight decay comment (#4228)

Browse files
Files changed (1) hide show
  1. train.py +2 -2
train.py CHANGED
@@ -128,9 +128,9 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
128
  for v in model.modules():
129
  if hasattr(v, 'bias') and isinstance(v.bias, nn.Parameter): # bias
130
  g2.append(v.bias)
131
- if isinstance(v, nn.BatchNorm2d): # weight with decay
132
  g0.append(v.weight)
133
- elif hasattr(v, 'weight') and isinstance(v.weight, nn.Parameter): # weight without decay
134
  g1.append(v.weight)
135
 
136
  if opt.adam:
 
128
  for v in model.modules():
129
  if hasattr(v, 'bias') and isinstance(v.bias, nn.Parameter): # bias
130
  g2.append(v.bias)
131
+ if isinstance(v, nn.BatchNorm2d): # weight (no decay)
132
  g0.append(v.weight)
133
+ elif hasattr(v, 'weight') and isinstance(v.weight, nn.Parameter): # weight (with decay)
134
  g1.append(v.weight)
135
 
136
  if opt.adam: