Skip to content
Snippets Groups Projects
Commit a4e1a0b2 authored by Pat Alt's avatar Pat Alt
Browse files

attempting a run without normalising digits to between -1 and 1

parent 9a340761
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
......@@ -137,15 +137,16 @@ savefig(plt, joinpath(output_images_path, "surrogate_gone_wrong.png"))
```{julia}
function pre_process(x; noise::Float32=0.03f0)
ϵ = Float32.(randn(size(x)) * noise)
x = @.(2 * x - 1) .+ ϵ
# x = @.(2 * x - 1)
x += ϵ
return x
end
```
```{julia}
# Hyper:
_retrain = false
_regen = false
_retrain = true
_regen = true
# Data:
n_obs = 10000
......@@ -179,7 +180,7 @@ _finaliser = x -> x # finaliser function
```{julia}
# JEM parameters:
𝒟x = Uniform(-1,1)
𝒟x = Uniform(0,1)
𝒟y = Categorical(ones(output_dim) ./ output_dim)
sampler = ConditionalSampler(
𝒟x, 𝒟y,
......@@ -306,7 +307,7 @@ model_performance = DataFrame()
for (mod_name, mod) in model_dict
# Test performance:
test_data = load_mnist_test()
test_data.X = pre_process.(test_data.X, noise=0.0f0)
# test_data.X = pre_process.(test_data.X, noise=0.0f0)
_perf = CounterfactualExplanations.Models.model_evaluation(mod, test_data, measure=collect(values(measure)))
_perf = DataFrame([[p] for p in _perf], collect(keys(measure)))
_perf.mod_name .= mod_name
......
No preview for this file type
......@@ -310,6 +310,7 @@ As noted by \citet{guidotti2022counterfactual}, these distance-based measures ar
\item ECCCo is sensitive to optimizer (Adam works well), learning rate and distance metric (l1 currently only one that works)
\item SGLD takes time
\item REVISE has benefit of lower dimensional space
\item For MNIST it seems that ECCCo is better at reducing pixel values than increasing them (better at erasing than writing)
\end{itemize}
\section{Discussion}
......
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