From 00d59ca87d3e7a543f0d2f211bcb27ccb0b1af9b Mon Sep 17 00:00:00 2001
From: lucas_miranda <lucasmiranda42@gmail.com>
Date: Sat, 5 Dec 2020 23:45:43 +0100
Subject: [PATCH] Added hyperparameter logging for run trial and cluster number

---
 deepof_experiments.smk        | 11 ++++++-----
 run_deepof_experiments.sbatch |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/deepof_experiments.smk b/deepof_experiments.smk
index ed6c45ea..ba80cdc1 100644
--- a/deepof_experiments.smk
+++ b/deepof_experiments.smk
@@ -15,16 +15,17 @@ import os
 
 outpath = "/u/lucasmir/DLC/DLC_autoencoders/DeepOF/deepof/logs/"
 losses = ["ELBO", "MMD", "ELBO+MMD"]
-encodings = [2, 4, 6, 8, 12, 16]
-
+encodings = [2, 4, 6, 8, 10, 12, 14, 16]
+cluster_numbers = [i+1 for i in range(10)]
 
 rule deepof_experiments:
     input:
         expand(
             "/u/lucasmir/DLC/DLC_autoencoders/DeepOF/deepof/logs/dimension_and_loss_experiments/trained_weights/"
-            "GMVAE_loss={loss}_encoding={encs}_run_1_final_weights.h5",
+            "GMVAE_loss={loss}_encoding={encs}_k={k}_run_1_final_weights.h5",
             loss=losses,
             encs=encodings,
+            k=cluster_numbers,
         ),
 
 
@@ -62,13 +63,13 @@ rule explore_encoding_dimension_and_loss_function:
     output:
         trained_models=os.path.join(
             outpath,
-            "dimension_and_loss_experiments/trained_weights/GMVAE_loss={loss}_encoding={encs}_run_1_final_weights.h5",
+            "dimension_and_loss_experiments/trained_weights/GMVAE_loss={loss}_encoding={encs}_k={k}_run_1_final_weights.h5",
         ),
     shell:
         "pipenv run python -m deepof.train_model "
         "--train-path {input.data_path} "
         "--val-num 10 "
-        "--components 10 "
+        "--components {wildcards.k} "
         "--input-type coords "
         "--predictor 0 "
         "--variational True "
diff --git a/run_deepof_experiments.sbatch b/run_deepof_experiments.sbatch
index a5f467e0..dc4f5d80 100644
--- a/run_deepof_experiments.sbatch
+++ b/run_deepof_experiments.sbatch
@@ -13,4 +13,4 @@ module load tensorrt/7.1.3
 module load tensorflow/gpu/2.3.0
 module load tensorboard/2.3.0
 
-pipenv run snakemake --snakefile deepof_experiments.smk deepof_experiments -j 8 --latency-wait 15 --cluster-config cluster.json --cluster "sbatch --time={cluster.time} --mem={cluster.mem} --exclude={cluster.excl} -o {cluster.stdout} -e {cluster.stderr} --job-name={cluster.jobname} --cpus-per-task={cluster.cpus} --constraint="gpu" --gres=gpu:gtx980:1" > deepof_experiments.out 2> deepof_experiments.err
+pipenv run snakemake --snakefile deepof_experiments.smk deepof_experiments -j 10 --latency-wait 15 --cluster-config cluster.json --cluster "sbatch --time={cluster.time} --mem={cluster.mem} --exclude={cluster.excl} -o {cluster.stdout} -e {cluster.stderr} --job-name={cluster.jobname} --cpus-per-task={cluster.cpus} --constraint="gpu" --gres=gpu:gtx980:1" > deepof_experiments.out 2> deepof_experiments.err
-- 
GitLab