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

more cleaning up

parent f81bf2bf
No related branches found
No related tags found
1 merge request!7669 initial run including fmnist lenet and new method
n_obs = Int(1000 / (1.0 - TEST_SIZE)) n_obs = Int(1000 / (1.0 - TEST_SIZE))
counterfactual_data, test_data = train_test_split(load_circles(n_obs; noise=0.05, factor=0.5); test_size=TEST_SIZE) counterfactual_data, test_data = train_test_split(load_circles(n_obs; noise=0.05, factor=0.5); test_size=TEST_SIZE)
run_experiment( run_experiment(
counterfactual_data, test_data; dataname="Circles", counterfactual_data, test_data;
dataname="Circles",
n_hidden=32, n_hidden=32,
α=[1.0, 1.0, 1e-2], α=[1.0, 1.0, 1e-2],
sampling_batch_size=nothing, sampling_batch_size=nothing,
sampling_steps=20, sampling_steps=20,
λ₁=0.25, Λ=[0.25, 0.75, 0.75],
λ₂ = 0.75,
λ₃ = 0.75,
opt=Flux.Optimise.Descent(0.01), opt=Flux.Optimise.Descent(0.01),
use_class_loss = false,
) )
\ No newline at end of file
...@@ -11,13 +11,20 @@ Base.@kwdef struct Experiment ...@@ -11,13 +11,20 @@ Base.@kwdef struct Experiment
builder::Union{Nothing,MLJFlux.Builder} = nothing builder::Union{Nothing,MLJFlux.Builder} = nothing
𝒟x::Distribution = Normal() 𝒟x::Distribution = Normal()
sampling_batch_size::Int = 50 sampling_batch_size::Int = 50
sampling_steps::Int = 50
min_batch_size::Int = 128 min_batch_size::Int = 128
epochs::Int = 100
n_hidden::Int = 32
activation::Function = Flux.relu
α::AbstractArray = [1.0, 1.0, 1e-1]
n_ens::Int = 5
use_ensembling::Bool = true
coverage::Float64 = DEFAULT_COVERAGE coverage::Float64 = DEFAULT_COVERAGE
generators::Union{Nothing,Dict} = nothing generators::Union{Nothing,Dict} = nothing
n_individuals::Int = 50 n_individuals::Int = 50
ce_measures::AbstractArray = CE_MEASURES ce_measures::AbstractArray = CE_MEASURES
model_measures::Dict = MODEL_MEASURES model_measures::Dict = MODEL_MEASURES
use_class_loss::Bool = true use_class_loss::Bool = false
use_variants::Bool = true use_variants::Bool = true
Λ::AbstractArray = [0.25, 0.75, 0.75] Λ::AbstractArray = [0.25, 0.75, 0.75]
Λ_Δ::AbstractArray = Λ Λ_Δ::AbstractArray = Λ
......
...@@ -12,10 +12,6 @@ run_experiment( ...@@ -12,10 +12,6 @@ run_experiment(
sampling_batch_size=nothing, sampling_batch_size=nothing,
sampling_steps = 30, sampling_steps = 30,
use_ensembling = true, use_ensembling = true,
λ₁ = 0.1, Λ=[0.1, 0.5, 0.5],
λ₂ = 0.5,
λ₃ = 0.5,
opt = Flux.Optimise.Descent(0.05), opt = Flux.Optimise.Descent(0.05),
use_class_loss=false,
use_variants=false,
) )
\ No newline at end of file
...@@ -3,4 +3,7 @@ counterfactual_data, test_data = train_test_split( ...@@ -3,4 +3,7 @@ counterfactual_data, test_data = train_test_split(
load_blobs(n_obs; cluster_std=0.1, center_box=(-1.0 => 1.0)); load_blobs(n_obs; cluster_std=0.1, center_box=(-1.0 => 1.0));
test_size=TEST_SIZE test_size=TEST_SIZE
) )
run_experiment(counterfactual_data, test_data; dataname="Linearly Separable") run_experiment(
\ No newline at end of file counterfactual_data, test_data;
dataname="Linearly Separable"
)
\ No newline at end of file
...@@ -52,7 +52,7 @@ run_experiment( ...@@ -52,7 +52,7 @@ run_experiment(
𝒟x = Uniform(-1.0, 1.0), 𝒟x = Uniform(-1.0, 1.0),
α = [1.0,1.0,1e-2], α = [1.0,1.0,1e-2],
sampling_batch_size = 10, sampling_batch_size = 10,
ssampling_steps=25, sampling_steps=25,
use_ensembling = true, use_ensembling = true,
generators = generator_dict, generators = generator_dict,
) )
\ No newline at end of file
...@@ -17,7 +17,8 @@ function prepare_models(exp::Experiment) ...@@ -17,7 +17,8 @@ function prepare_models(exp::Experiment)
models = default_models(; models = default_models(;
sampler=sampler, sampler=sampler,
builder=builder, builder=builder,
batch_size=batch_size(exp) batch_size=batch_size(exp),
sampling_steps=exp.sampling_steps,
) )
end end
@info "Training models." @info "Training models."
......
n_obs = Int(2500 / (1.0 - TEST_SIZE)) n_obs = Int(2500 / (1.0 - TEST_SIZE))
counterfactual_data, test_data = train_test_split(load_moons(n_obs); test_size=TEST_SIZE) counterfactual_data, test_data = train_test_split(load_moons(n_obs); test_size=TEST_SIZE)
run_experiment( run_experiment(
counterfactual_data, test_data; dataname="Moons", counterfactual_data, test_data;
dataname="Moons",
epochs=500, epochs=500,
n_hidden=32, n_hidden=32,
activation = Flux.relu, activation = Flux.relu,
α=[1.0, 1.0, 1e-1],
sampling_batch_size=10, sampling_batch_size=10,
sampling_steps=30, sampling_steps=30,
λ₁=0.25, Λ=[0.25, 0.75, 0.75],
λ₂=0.75,
λ₃=0.75,
opt=Flux.Optimise.Descent(0.05), opt=Flux.Optimise.Descent(0.05),
use_class_loss=false
) )
\ No newline at end of file
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