Skip to content
Snippets Groups Projects
Commit d8864555 authored by pat-alt's avatar pat-alt
Browse files

:yawning_face:

parent 2122f958
No related branches found
No related tags found
No related merge requests found
artifacts/results/images/mnist_motivation.png

14.3 KiB

No preview for this file type
No preview for this file type
......@@ -131,6 +131,27 @@ display(plt)
savefig(plt, joinpath(output_images_path, "surrogate_gone_wrong.png"))
```
```{julia}
ces = zip([ce_wachter, ce_jsma, ce_strong])
counterfactuals = reduce((x,y)->cat(x,y,dims=3),map(ce -> CounterfactualExplanations.counterfactual(ce[1]), ces))
phat = reduce((x,y) -> cat(x,y,dims=3), map(ce -> target_probs(ce[1]), ces))
plts = [p1]
for x in zip(eachslice(counterfactuals; dims=3), eachslice(phat; dims=3), ["Wachter","Schut","REVISE"])
ce, _phat, _name = (x[1],x[2],x[3])
_title = "$(_name) (p=$(round(_phat[1]; digits=2)))"
plt = Plots.plot(
convert2image(MNIST, reshape(ce,28,28)),
axis=nothing,
size=(img_height, img_height),
title=_title
)
plts = [plts..., plt]
end
plt = Plots.plot(plts...; size=(img_height*length(plts),img_height), layout=(1,length(plts)))
display(plt)
savefig(plt, joinpath(output_images_path, "mnist_motivation.png"))
```
### ECCCo
```{julia}
......
No preview for this file type
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment