Sfoglia il codice sorgente

Fix weight decay comment (#4228)

modifyDataloader
Glenn Jocher GitHub 3 anni fa
parent
commit
8d3c3ef45c
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. +2
    -2
      train.py

+ 2
- 2
train.py Vedi File

@@ -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:

Loading…
Annulla
Salva