From fd9e7e2b6cf8d186c10b3db1a824e0afb375e092 Mon Sep 17 00:00:00 2001
From: Lucas Miranda <lucas_miranda@psych.mpg.de>
Date: Thu, 3 Dec 2020 15:29:18 +0100
Subject: [PATCH] Added outpath to snakemake pipeline

---
 deepof_experiments.smk | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/deepof_experiments.smk b/deepof_experiments.smk
index 539a38dd..430ae3da 100644
--- a/deepof_experiments.smk
+++ b/deepof_experiments.smk
@@ -11,7 +11,9 @@ Plot rule graph: snakemake --snakefile deepof_experiments.smk --forceall --ruleg
 
 """
 
+import os
 
+outpath = "/u/lucasmir/DLC/DLC_autoencoders/DeepOF/deepof/logs/"
 losses = ["ELBO", "MMD", "ELBO+MMD"]
 encodings = [2, 4, 6, 8, 12, 16]
 
@@ -19,7 +21,7 @@ encodings = [2, 4, 6, 8, 12, 16]
 rule deepof_experiments:
     input:
         expand(
-            "/u/lucasmir/DLC/DLC_autoencoders/DeepOF/deepof/GMVAE_loss={loss}_encoding={encs}_final_weights.h5",
+            "/u/lucasmir/DLC/DLC_autoencoders/DeepOF/deepof/logs/dimension_and_loss_experiments/trained_weights/GMVAE_loss={loss}_encoding={encs}_final_weights.h5",
             loss=losses,
             encs=encodings,
         ),
@@ -29,9 +31,14 @@ rule explore_encoding_dimension_and_loss_function:
     input:
         data_path="/u/lucasmir/DLC/DLC_models/deepof_single_topview/",
     output:
-        trained_models="/u/lucasmir/DLC/DLC_autoencoders/DeepOF/deepof/GMVAE_loss={loss}_encoding={encs}_final_weights.h5",
+        trained_models=os.path.join(
+            outpath,
+            "dimension_and_loss_experiments/trained_weights/GMVAE_loss={loss}_encoding={encs}_final_weights.h5",
+        ),
     shell:
-        "pipenv run python -m deepof.train_model --train-path {input.data_path} --val-num 10 --components 10 --input-type coords --predictor 0 --variational True --loss {wildcards.loss} --kl-warmup 20 --mmd-warmup 20 --encoding-size {wildcards.encs} --batch-size 256 --window-size 11 --window-step 11 --exclude-bodyparts Tail_base,Tail_1,Tail_2,Tail_tip,Spine_2 --stability-check 3"
+        "pipenv run python -m deepof.train_model --train-path {input.data_path} --val-num 10 --components 10 --input-type coords --predictor 0 --variational True --loss {wildcards.loss} --kl-warmup 20 --mmd-warmup 20 --encoding-size {wildcards.encs} --batch-size 256 --window-size 11 --window-step 11 --exclude-bodyparts Tail_base,Tail_1,Tail_2,Tail_tip,Spine_2 --stability-check 3 --out-path {}/dimension_and_loss_experiments/trained_weights".format(
+            outpath
+        )
 
 
 # rule explore_number_of_components:
-- 
GitLab