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

fashion mnist

parent bb11c7b0
No related branches found
No related tags found
1 merge request!7669 initial run including fmnist lenet and new method
# Training data:
dataname = "Fashion MNIST"
n_obs = 10000
counterfactual_data = load_fashion_mnist(n_obs)
counterfactual_data.X = ECCCo.pre_process.(counterfactual_data.X)
......@@ -11,37 +12,46 @@ counterfactual_data.generative_model = vae
# Test data:
test_data = load_fashion_mnist_test()
# Model tuning:
model_tuning_params = DEFAULT_MODEL_TUNING_LARGE
# Tuning parameters:
tuning_params = DEFAULT_GENERATOR_TUNING
push!(tuning_params.Λ, [0.1, 0.1, 3.0])
# Additional models:
add_models = Dict(
"LeNet-5" => lenet5,
"ResNet-18" => resnet18(; epochs=10),
)
# Default builder:
n_hidden = 128
activation = Flux.swish
builder = MLJFlux.@builder Flux.Chain(
Dense(n_in, n_hidden, activation),
Dense(n_hidden, n_out),
)
# Number of individuals:
n_ind = N_IND_SPECIFIED ? N_IND : 5
# Run:
run_experiment(
counterfactual_data, test_data;
dataname="Fashion-MNIST",
builder= builder,
𝒟x = Uniform(-1.0, 1.0),
α = [1.0,1.0,1e-2],
sampling_batch_size = 10,
# Parameter choices:
params = (
n_ind=N_IND_SPECIFIED ? N_IND : 10,
builder=default_builder(n_hidden=128, n_layers=2, activation=Flux.swish),
𝒟x=Uniform(-1.0, 1.0),
α=[1.0, 1.0, 1e-2],
sampling_batch_size=10,
sampling_steps=50,
use_ensembling = true,
n_individuals = n_ind,
nsamples = 10,
nmin = 10,
use_variants = false,
use_class_loss = true,
use_ensembling=true,
use_variants=false,
additional_models=add_models,
epochs = 10,
)
\ No newline at end of file
epochs=10,
nsamples=10,
nmin=1,
niter_eccco=100
)
if !GRID_SEARCH
run_experiment(
counterfactual_data, test_data;
dataname=dataname,
params...
)
else
grid_search(
counterfactual_data, test_data;
dataname=dataname,
tuning_params=tuning_params
)
end
\ No newline at end of file
#!/bin/bash
#SBATCH --job-name="Train Fashion MNIST (ECCCo)"
#SBATCH --time=03:00:00
#SBATCH --ntasks=1
#SBATCH --gpus-per-task=1
#SBATCH --cpus-per-task=1
#SBATCH --partition=gpu
#SBATCH --mem-per-cpu=8GB
#SBATCH --account=research-eemcs-insy
#SBATCH --mail-type=END # Set mail type to 'END' to receive a mail when the job finishes.
srun julia --project=experiments experiments/run_experiments.jl -- data=mnist output_path=results only_models > experiments/train_mnist.log
\ No newline at end of file
#!/bin/bash
#SBATCH --job-name="Train Fashion MNIST (ECCCo)"
#SBATCH --time=03:00:00
#SBATCH --ntasks=1
#SBATCH --gpus-per-task=1
#SBATCH --cpus-per-task=1
#SBATCH --partition=gpu
#SBATCH --mem-per-cpu=4GB
#SBATCH --account=innovation
#SBATCH --mail-type=END # Set mail type to 'END' to receive a mail when the job finishes.
srun julia --project=experiments experiments/run_experiments.jl -- data=mnist output_path=results only_models > experiments/train_mnist.log
\ 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