You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-7Lines changed: 22 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ ___
9
9
10
10
Explainable AI in Julia using [Flux.jl](https://fluxml.ai).
11
11
12
-
This package implements interpretability methods and visualizations for neural networks, similar to [Captum](https://github.com/pytorch/captum)for PyTorch and [iNNvestigate](https://github.com/albermax/innvestigate) for Keras models.
12
+
This package implements interpretability methods and visualizations for neural networks, similar to [Captum][captum-repo] and [Zennit][zennit-repo]for PyTorch and [iNNvestigate][innvestigate-repo] for Keras models.
13
13
14
14
## Installation
15
15
To install this package and its dependencies, open the Julia REPL and run
@@ -20,22 +20,31 @@ julia> ]add ExplainableAI
20
20
⚠️ This package is still in early development, expect breaking changes. ⚠️
21
21
22
22
## Example
23
-
Let's use LRP to explain why an image of a cat gets classified as a cat:
23
+
Let's use LRP to explain why an MNIST digit gets classified as a 9 using a small pre-trained LeNet5 model.
24
+
If you want to follow along, the model can be found [here][model-bson-url].
24
25
```julia
25
26
using ExplainableAI
26
27
using Flux
27
-
using Metalhead
28
+
using MLDatasets
29
+
using BSON:@load
28
30
29
31
# Load model
30
-
vgg =VGG19()
31
-
model =strip_softmax(vgg.layers)
32
+
@load"model.bson" model
33
+
model =strip_softmax(model)
34
+
35
+
# Load input
36
+
x, _ = MNIST.testdata(Float32, 10)
37
+
input =reshape(x, 28, 28, 1, :) # reshape to WHCN format
> Adrian Hill acknowledges support by the Federal Ministry of Education and Research (BMBF) for the Berlin Institute for the Foundations of Learning and Data (BIFOLD) (01IS18037A).
0 commit comments