Skip to content

Commit a73133b

Browse files
committed
Relaxed tolerance
1 parent 4023365 commit a73133b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/utils_AD.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,20 @@ function test_AD(AD::Symbol, kernelfunction, args = nothing, dims = [3, 3])
9191
# Testing kernel evaluations
9292
x = rand(rng, dims[1])
9393
y = rand(rng, dims[1])
94-
@test gradient(Val(AD), x -> k(x, y), x) gradient(Val(:FiniteDiff), x -> k(x, y), x) atol=1e-8
95-
@test gradient(Val(AD), y -> k(x, y), y) gradient(Val(:FiniteDiff), y -> k(x, y), y) atol=1e-8
94+
@test gradient(Val(AD), x -> k(x, y), x) gradient(Val(:FiniteDiff), x -> k(x, y), x) rtol=1e-5
95+
@test gradient(Val(AD), y -> k(x, y), y) gradient(Val(:FiniteDiff), y -> k(x, y), y) rtol=1e-5
9696
if !(args === nothing)
97-
@test gradient(Val(AD), p -> kernelfunction(p)(x,y), args) gradient(Val(:FiniteDiff), p -> kernelfunction(p)(x, y), args) atol=1e-8
97+
@test gradient(Val(AD), p -> kernelfunction(p)(x,y), args) gradient(Val(:FiniteDiff), p -> kernelfunction(p)(x, y), args) rtol=1e-5
9898
end
9999
# Testing kernel matrices
100100
A = rand(rng, dims...)
101101
B = rand(rng, dims...)
102102
for dim in 1:2
103-
@test gradient(Val(AD), x -> testfunction(k, x, dim), A) gradient(Val(:FiniteDiff), x -> testfunction(k, x, dim), A) atol=1e-8
104-
@test gradient(Val(AD), a -> testfunction(k, a, B, dim), A) gradient(Val(:FiniteDiff), a -> testfunction(k, a, B, dim), A) atol=1e-8
105-
@test gradient(Val(AD), b -> testfunction(k, A, b, dim), B) gradient(Val(:FiniteDiff), b -> testfunction(k, A, b, dim), B) atol=1e-8
103+
@test gradient(Val(AD), x -> testfunction(k, x, dim), A) gradient(Val(:FiniteDiff), x -> testfunction(k, x, dim), A) rtol=1e-5
104+
@test gradient(Val(AD), a -> testfunction(k, a, B, dim), A) gradient(Val(:FiniteDiff), a -> testfunction(k, a, B, dim), A) rtol=1e-5
105+
@test gradient(Val(AD), b -> testfunction(k, A, b, dim), B) gradient(Val(:FiniteDiff), b -> testfunction(k, A, b, dim), B) rtol=1e-5
106106
if !(args === nothing)
107-
@test gradient(Val(AD), p -> testfunction(kernelfunction(p), A, dim), args) gradient(Val(:FiniteDiff), p -> testfunction(kernelfunction(p), A, dim), args) atol=1e-8
107+
@test gradient(Val(AD), p -> testfunction(kernelfunction(p), A, dim), args) gradient(Val(:FiniteDiff), p -> testfunction(kernelfunction(p), A, dim), args) rtol=1e-5
108108
end
109109
end
110110
end

0 commit comments

Comments
 (0)