may help numerical tests

This commit is contained in:
Mike J Innes 2018-02-19 12:51:02 +00:00
parent d22270050c
commit 4035745f6e

View File

@ -19,4 +19,6 @@ function ngradient(f, xs::AbstractArray...)
return grads return grads
end 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))