@@ -17,13 +17,14 @@ testfunction(k,A) = sum(kernelmatrix(k,A))
17
17
# For debugging
18
18
19
19
# # Zygote
20
- # Zygote.gradient(x->testfunction(SquaredExponentialKernel(x),A,B),vl)
21
- # Zygote.gradient(x->testfunction(SquaredExponentialKernel(x),A),vl)
22
- # Zygote.gradient(x->testfunction(SquaredExponentialKernel(x),A,B),l)
23
- # Zygote.gradient(x->testfunction(SquaredExponentialKernel(x),A),l)
24
-
20
+ Zygote. gradient (x-> testfunction (SquaredExponentialKernel (x),A),vl)
21
+ Zygote. gradient (x-> testfunction (SquaredExponentialKernel (x),A,B),vl)
22
+ Zygote. gradient (x-> testfunction (SquaredExponentialKernel (x),A,B),l)
23
+ Zygote. gradient (x-> testfunction (SquaredExponentialKernel (x),A),l)
25
24
# # Tracker
26
- Tracker. gradient (x-> testfunction (SquaredExponentialKernel (x),A,B),vl)
25
+ Tracker. gradient (x-> testfunction (SquaredExponentialKernel (vl),x,B),A)
26
+ Tracker. gradient (x-> testfunction (SquaredExponentialKernel (l),x[:,:]),A)
27
+ # Tracker.gradient(x->testfunction(SquaredExponentialKernel(x),A,B),vl)
27
28
Tracker. gradient (x-> testfunction (SquaredExponentialKernel (x),A),vl)
28
29
Tracker. gradient (x-> testfunction (SquaredExponentialKernel (x),A,B),l)
29
30
Tracker. gradient (x-> testfunction (SquaredExponentialKernel (x),A),l)
@@ -56,42 +57,42 @@ ForwardDiff.gradient(x->testfunction(SquaredExponentialKernel(x[1]),A),[l])
56
57
end
57
58
end
58
59
59
- @testset " Tracker AutomaticDifferentation test" begin
60
+ @testset " ForwardDiff AutomaticDifferentation test" begin
60
61
@testset " ARD" begin
61
62
for k in kernels
62
- @test_nowarn Tracker . gradient (x-> testfunction (k (x),A,B),vl)
63
- @test_broken Tracker . gradient (x-> testfunction (k (vl),x,B),A)
64
- @test_nowarn Tracker . gradient (x-> testfunction (k (x),A),vl)
65
- @test_broken Tracker . gradient (x-> testfunction (k (vl),x),A)
63
+ @test_nowarn ForwardDiff . gradient (x-> testfunction (k (x),A,B),vl)
64
+ @test_nowarn ForwardDiff . gradient (x-> testfunction (k (vl),x,B),A)
65
+ @test_nowarn ForwardDiff . gradient (x-> testfunction (k (x),A),vl)
66
+ @test_nowarn ForwardDiff . gradient (x-> testfunction (k (vl),x),A)
66
67
end
67
68
end
68
69
@testset " ISO" begin
69
70
for k in kernels
70
- @test_nowarn Tracker. gradient (x-> testfunction (k (x[1 ]),A,B),[l])
71
- @test_broken Tracker. gradient (x-> testfunction (k (l),x,B),A)
72
- @test_nowarn Tracker. gradient (x-> testfunction (k (x[1 ]),A),[l])
73
- @test_broken Tracker. gradient (x-> testfunction (k (l),x),A)
74
-
71
+ @test_nowarn ForwardDiff. gradient (x-> testfunction (k (x[1 ]),A,B),[l])
72
+ @test_nowarn ForwardDiff. gradient (x-> testfunction (k (l),x,B),A)
73
+ @test_nowarn ForwardDiff. gradient (x-> testfunction (k (x[1 ]),A),[l])
74
+ @test_nowarn ForwardDiff. gradient (x-> testfunction (k (l[1 ]),x),A)
75
75
end
76
76
end
77
77
end
78
78
79
79
80
- @testset " ForwardDiff AutomaticDifferentation test" begin
80
+ @testset " Tracker AutomaticDifferentation test" begin
81
81
@testset " ARD" begin
82
82
for k in kernels
83
- @test_nowarn ForwardDiff. gradient (x-> testfunction (k (x),A,B),vl)
84
- @test_nowarn ForwardDiff. gradient (x-> testfunction (k (vl),x,B),A)
85
- @test_nowarn ForwardDiff. gradient (x-> testfunction (k (x),A),vl)
86
- @test_nowarn ForwardDiff. gradient (x-> testfunction (k (vl),x),A)
83
+ @test all (Tracker . gradient (x -> testfunction ( k (x),A,B),vl)[ 1 ] .≈ ForwardDiff. gradient (x-> testfunction (k (x),A,B),vl) )
84
+ @test_broken all (Tracker . gradient (x -> testfunction ( k (vl),x,B),A)[ 1 ] .≈ ForwardDiff. gradient (x-> testfunction (k (vl),x,B),A) )
85
+ @test all (Tracker . gradient (x -> testfunction ( k (x),A),vl)[ 1 ] .≈ ForwardDiff. gradient (x-> testfunction (k (x),A),vl) )
86
+ @test_broken all .(Tracker . gradient (x -> testfunction ( k (vl),x),A) .≈ ForwardDiff. gradient (x-> testfunction (k (vl),x),A) )
87
87
end
88
88
end
89
89
@testset " ISO" begin
90
90
for k in kernels
91
- @test_nowarn ForwardDiff. gradient (x-> testfunction (k (x[1 ]),A,B),[l])
92
- @test_nowarn ForwardDiff. gradient (x-> testfunction (k (l),x,B),A)
93
- @test_nowarn ForwardDiff. gradient (x-> testfunction (k (x[1 ]),A),[l])
94
- @test_nowarn ForwardDiff. gradient (x-> testfunction (k (l[1 ]),x),A)
91
+ @test_nowarn Tracker. gradient (x-> testfunction (k (x[1 ]),A,B),[l])
92
+ @test_broken Tracker. gradient (x-> testfunction (k (l),x,B),A)
93
+ @test_nowarn Tracker. gradient (x-> testfunction (k (x[1 ]),A),[l])
94
+ @test_broken Tracker. gradient (x-> testfunction (k (l),x),A)
95
+
95
96
end
96
97
end
97
98
end
0 commit comments