Skip to content

Commit 72790f2

Browse files
authored
Update XAIBase compatibility (#7)
1 parent be939ee commit 72790f2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ ColorSchemes = "3"
1515
Colors = "0.12"
1616
Crayons = "4"
1717
FixedPointNumbers = "0.8"
18-
XAIBase = "3"
18+
XAIBase = "3,4"
1919
julia = "1.6"

test/test_xaibase.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
using XAIBase
22

3+
input = 42
34
val = output = [1 6; 2 5; 3 4]
45
text = [["Test", "Text", "Heatmap"], ["another", "dummy", "input"]]
56
output_selection = [CartesianIndex(1, 2), CartesianIndex(3, 4)] # irrelevant
6-
expl = Explanation(val, output, output_selection, :Gradient, :sensitivity)
7+
expl = Explanation(val, input, output, output_selection, :Gradient, :sensitivity)
78
h = heatmap(expl, text)
89
@test_reference "references/Gradient1.txt" repr("text/plain", h[1])
910
@test_reference "references/Gradient2.txt" repr("text/plain", h[2])
1011

1112
expl = Explanation(
12-
val[:, 1:1], output[:, 1:1], output_selection[1], :Gradient, :sensitivity
13+
val[:, 1:1], input, output[:, 1:1], output_selection[1], :Gradient, :sensitivity
1314
)
1415
h = heatmap(expl, text[1])
1516
@test_reference "references/Gradient1.txt" repr("text/plain", only(h))
1617

17-
expl = Explanation(val, output, output_selection, :LRP, :attribution)
18+
expl = Explanation(val, input, output, output_selection, :LRP, :attribution)
1819
h = heatmap(expl, text)
1920
@test_reference "references/LRP1.txt" repr("text/plain", h[1])
2021
@test_reference "references/LRP2.txt" repr("text/plain", h[2])

0 commit comments

Comments
 (0)