may help numerical tests

This commit is contained in:
Mike J Innes 2018-02-19 12:51:02 +00:00
parent d22270050c
commit 4035745f6e
1 changed files with 3 additions and 1 deletions

View File

@ -19,4 +19,6 @@ function ngradient(f, xs::AbstractArray...)
return grads
end
gradcheck(f, xs...) = all(isapprox.(ngradient(f, xs...), gradient(f, xs...), rtol = 1e-5))
gradcheck(f, xs...) =
all(isapprox.(ngradient(f, xs...),
gradient(f, xs...), rtol = 1e-5, atol = 1e-5))