We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f6770fa commit ec4802cCopy full SHA for ec4802c
word_language_model/main.py
@@ -88,7 +88,7 @@ def clip_gradient(model, clip):
88
modulenorm = p.grad.data.norm()
89
totalnorm += modulenorm ** 2
90
totalnorm = math.sqrt(totalnorm)
91
- return min(1, args.clip / (totalnorm + 1e-6))
+ return min(1, clip / (totalnorm + 1e-6))
92
93
94
def repackage_hidden(h):
0 commit comments