Skip to content
Snippets Groups Projects
Commit 284da338 authored by Jacqueline He's avatar Jacqueline He
Browse files

Update model.py

parent a0ccd440
Branches master
No related tags found
No related merge requests found
...@@ -281,6 +281,9 @@ class GPT(nn.Module): ...@@ -281,6 +281,9 @@ class GPT(nn.Module):
elif pn.endswith('weight') and isinstance(m, blacklist_weight_modules): elif pn.endswith('weight') and isinstance(m, blacklist_weight_modules):
# weights of blacklist modules will NOT be weight decayed # weights of blacklist modules will NOT be weight decayed
no_decay.add(fpn) no_decay.add(fpn)
else: # NOTE: jh added
if pn.endswith('weight'):
decay.add(fpn)
# validate that we considered every parameter # validate that we considered every parameter
param_dict = {pn: p for pn, p in self.named_parameters()} param_dict = {pn: p for pn, p in self.named_parameters()}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment