Commit 0b6bdca6 authored by Mohammad's avatar Mohammad
Browse files

removed optimized l2 grad clipping

parent 4ff2c963
...@@ -101,8 +101,8 @@ def clip_grad_norm(parameters, max_norm, norm_type=2): ...@@ -101,8 +101,8 @@ def clip_grad_norm(parameters, max_norm, norm_type=2):
if clip_coef < 1: if clip_coef < 1:
for p in parameters: for p in parameters:
p.grad.data.mul_(clip_coef) p.grad.data.mul_(clip_coef)
elif norm_type == 2: #elif norm_type == 2:
total_norm = l2_grad_clipper(parameters, max_norm) # total_norm = l2_grad_clipper(parameters, max_norm)
else: else:
total_norm = 0 total_norm = 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