Skip to content

Commit ec4802c

Browse files
eriche2016soumith
authored andcommitted
Update main.py (#68)
1 parent f6770fa commit ec4802c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

word_language_model/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def clip_gradient(model, clip):
8888
modulenorm = p.grad.data.norm()
8989
totalnorm += modulenorm ** 2
9090
totalnorm = math.sqrt(totalnorm)
91-
return min(1, args.clip / (totalnorm + 1e-6))
91+
return min(1, clip / (totalnorm + 1e-6))
9292

9393

9494
def repackage_hidden(h):

0 commit comments

Comments
 (0)