Commit d673f672 authored by Xiang Gao's avatar Xiang Gao
Browse files

L2 only on weight

parent 81c163e7
...@@ -509,8 +509,7 @@ class Trainer: ...@@ -509,8 +509,7 @@ class Trainer:
if 'l2norm' in layer: if 'l2norm' in layer:
if layer['l2norm'] == 1: if layer['l2norm'] == 1:
c = layer['l2valu'] c = layer['l2valu']
for w in module.parameters(): l2reg.append((c, module.weight))
l2reg.append((c, w))
del layer['l2norm'] del layer['l2norm']
del layer['l2valu'] del layer['l2valu']
if len(layer) > 0: if len(layer) > 0:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment