This commit is contained in:
Yao Lu 2020-04-26 17:28:07 +08:00
parent 7d6f711c6f
commit 114f63a214
1 changed files with 1 additions and 1 deletions

View File

@ -555,7 +555,7 @@ mutable struct ClipNorm{T}
end
function apply!(o::ClipNorm, x, Δ)
Δnrm = norm(Δ, 2)
Δnrm = norm(Δ)
if Δnrm > o.thresh
rmul!(Δ, o.thresh / Δnrm)
end