Skip to content

Commit

Permalink
Update main.py (pytorch#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
eriche2016 authored and soumith committed Feb 16, 2017
1 parent f6770fa commit ec4802c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion word_language_model/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def clip_gradient(model, clip):
modulenorm = p.grad.data.norm()
totalnorm += modulenorm ** 2
totalnorm = math.sqrt(totalnorm)
return min(1, args.clip / (totalnorm + 1e-6))
return min(1, clip / (totalnorm + 1e-6))


def repackage_hidden(h):
Expand Down

0 comments on commit ec4802c

Please sign in to comment.