From 3324e305e3c699c0c1b9253ff0082763d495173b Mon Sep 17 00:00:00 2001
From: pat-alt <altmeyerpat@gmail.com>
Date: Thu, 19 Oct 2023 07:52:02 +0200
Subject: [PATCH] mnist

---
 experiments/daic/tuning/generators/mnist.sh |  6 +++---
 experiments/post_processing/results.jl      | 17 ++++++++++++++---
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/experiments/daic/tuning/generators/mnist.sh b/experiments/daic/tuning/generators/mnist.sh
index 370e43cc..005b87b0 100644
--- a/experiments/daic/tuning/generators/mnist.sh
+++ b/experiments/daic/tuning/generators/mnist.sh
@@ -2,10 +2,10 @@
 
 #SBATCH --job-name="MNIST Grid-search (ECCCo)"
 #SBATCH --time=02:00:00
-#SBATCH --ntasks=30
+#SBATCH --ntasks=40
 #SBATCH --cpus-per-task=10
 #SBATCH --partition=general
-#SBATCH --mem-per-cpu=6GB
+#SBATCH --mem-per-cpu=4GB
 #SBATCH --mail-type=END     # Set mail type to 'END' to receive a mail when the job finishes. 
 
 module use /opt/insy/modulefiles          # Use DAIC INSY software collection
@@ -13,4 +13,4 @@ module load openmpi
 
 source experiments/slurm_header.sh
 
-srun julia --project=experiments --threads $SLURM_CPUS_PER_TASK experiments/run_experiments.jl -- data=mnist output_path=results mpi grid_search threaded n_individuals=10 n_each=10 > experiments/logs/grid_search_mnist.log
+srun julia --project=experiments --threads $SLURM_CPUS_PER_TASK experiments/run_experiments.jl -- data=mnist output_path=results mpi grid_search threaded n_individuals=1 n_each=10 > experiments/logs/grid_search_mnist.log
diff --git a/experiments/post_processing/results.jl b/experiments/post_processing/results.jl
index f785b8cc..81f77140 100644
--- a/experiments/post_processing/results.jl
+++ b/experiments/post_processing/results.jl
@@ -11,12 +11,23 @@ function summarise_outcome(
 
     bmk = outcome.bmk
     measure = isnothing(measure) ? unique(bmk().variable) : measure
-
+    df = bmk()
+    # If the :run column is missing (single runs), add it:
+    if !(:run ∈ names(df))
+        df.run .= 1
+    end
+    # Aggregate per run:
     df =
-        groupby(bmk(), [:dataname, :generator, :model, :variable]) |>
+        groupby(df, [:dataname, :generator, :model, :run, :variable]) |>
         x ->
-            combine(x, :value => mean => :mean, :value => std => :std_wg) |>
+            combine(x, :value => mean => :mean_group, :value => std => :std_group) |>
             x -> subset(x, :variable => ByRow(x -> x ∈ measure))
+    # Compute mean and std across runs:
+    df =
+        groupby(df, [:dataname, :generator, :model, :variable]) |>
+        x ->
+            combine(x, :mean_group => mean => :mean, :mean_group => std => :std) 
+    # Subset:
     if !isnothing(model)
         df = subset(df, :model => ByRow(x -> x ∈ model))
     end
-- 
GitLab