26
26
testfunction (k, A, B, dim) = sum (kernelmatrix (k, A, B, obsdim = dim))
27
27
testfunction (k, A, dim) = sum (kernelmatrix (k, A, obsdim = dim))
28
28
29
- function test_AD (kernelname :: String , kernelfunction, args = nothing ; ADs = [:Zygote , :ForwardDiff , :ReverseDiff ], dims = [3 , 3 ])
30
- test_fd = test_FiniteDiff (kernelname, kernelfunction, args, dims)
29
+ function test_ADs ( kernelfunction, args = nothing ; ADs = [:Zygote , :ForwardDiff , :ReverseDiff ], dims = [3 , 3 ])
30
+ test_fd = test_FiniteDiff (kernelfunction, args, dims)
31
31
if ! test_fd. anynonpass
32
32
for AD in ADs
33
- test_AD (AD, kernelname, kernelfunction, args, dims)
33
+ test_AD (AD, kernelfunction, args, dims)
34
34
end
35
35
end
36
36
end
37
37
38
- function test_FiniteDiff (kernelname, kernelfunction, args = nothing , dims = [3 , 3 ])
38
+ function test_FiniteDiff (kernelfunction, args = nothing , dims = [3 , 3 ])
39
39
# Init arguments :
40
40
k = if args === nothing
41
41
kernelfunction ()
42
42
else
43
43
kernelfunction (args)
44
44
end
45
45
rng = MersenneTwister (42 )
46
- @testset " FiniteDifferences with $(kernelname) " begin
46
+ @testset " FiniteDifferences" begin
47
47
if k isa SimpleKernel
48
48
for d in log .([eps (), rand (rng)])
49
49
@test_nowarn gradient (Val (:FiniteDiff ), x -> kappa (k, exp (first (x))), [d])
@@ -70,8 +70,8 @@ function test_FiniteDiff(kernelname, kernelfunction, args = nothing, dims = [3,
70
70
end
71
71
end
72
72
73
- function test_AD (AD, kernelname , kernelfunction, args = nothing , dims = [3 , 3 ])
74
- @testset " Testing $(kernelname) with AD : $(AD) " begin
73
+ function test_AD (AD:: Symbol , kernelfunction, args = nothing , dims = [3 , 3 ])
74
+ @testset " $(AD) " begin
75
75
# Test kappa function
76
76
k = if args === nothing
77
77
kernelfunction ()
0 commit comments