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

L2 only on weight

parent 81c163e7
......@@ -509,8 +509,7 @@ class Trainer:
if 'l2norm' in layer:
if layer['l2norm'] == 1:
c = layer['l2valu']
for w in module.parameters():
l2reg.append((c, w))
l2reg.append((c, module.weight))
del layer['l2norm']
del layer['l2valu']
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