From 08fa4c5eea21c9a4bd2bb3c57457d7e63576b31e Mon Sep 17 00:00:00 2001 From: Sakib Rahman Date: Fri, 19 Jan 2024 13:25:45 -0500 Subject: [PATCH] Parametrise subsystem and model type for readability --- benchmarks/roman_pots/Snakefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/benchmarks/roman_pots/Snakefile b/benchmarks/roman_pots/Snakefile index 5d985771..6f755f2a 100644 --- a/benchmarks/roman_pots/Snakefile +++ b/benchmarks/roman_pots/Snakefile @@ -2,6 +2,8 @@ from itertools import product import hashlib DETECTOR_PATH = os.environ["DETECTOR_PATH"] +SUBSYSTEM = "roman_pots" +BENCHMARK = "dense_neural_network" DETECTOR_VERSION = ["23.11.0","23.12.0"] DETECTOR_CONFIG = ["epic_craterlake", "epic_brycecanyon"] NUM_TRAINING_INPUTS = [100,10] @@ -41,7 +43,7 @@ MODEL_VERSION = [ rule all: input: - expand("results/{detector_version}/{detector_config}/detector_benchmarks/roman_pots/ml/metadata/{detector_version}_{detector_config}_{model_version}.txt", + expand("results/{detector_version}/{detector_config}/detector_benchmarks/"+str(SUBSYSTEM)+"/"+str(BENCHMARK)+"/metadata/{detector_version}_{detector_config}_"+str(SUBSYSTEM)+"_"+str(BENCHMARK)+"_{model_version}.txt", detector_version=DETECTOR_VERSION, detector_config=DETECTOR_CONFIG, model_version=MODEL_VERSION) @@ -50,7 +52,7 @@ rule all: rule roman_pots_generate_neural_network_configs: input: output: - expand("results/{detector_version}/{detector_config}/detector_benchmarks/roman_pots/ml/metadata/{detector_version}_{detector_config}_{model_version}.txt", + expand("results/{detector_version}/{detector_config}/detector_benchmarks/"+str(SUBSYSTEM)+"/"+str(BENCHMARK)+"/metadata/{detector_version}_{detector_config}_"+str(SUBSYSTEM)+"_"+str(BENCHMARK)+"_{model_version}.txt", detector_version=DETECTOR_VERSION, detector_config=DETECTOR_CONFIG, model_version=MODEL_VERSION) @@ -63,12 +65,12 @@ rule roman_pots_generate_neural_network_configs: NUM_EPOCHS_PZ, LEARNING_RATE_PZ, SIZE_INPUT_PZ, SIZE_OUTPUT_PZ, N_LAYERS_PZ, SIZE_FIRST_HIDDEN_LAYER_PZ, MULTIPLIER_PZ, LEAK_RATE_PZ, NUM_EPOCHS_PY, LEARNING_RATE_PY, SIZE_INPUT_PY, SIZE_OUTPUT_PY, N_LAYERS_PY, SIZE_FIRST_HIDDEN_LAYER_PY, MULTIPLIER_PY, LEAK_RATE_PY, NUM_EPOCHS_PX, LEARNING_RATE_PX, SIZE_INPUT_PX, SIZE_OUTPUT_PX, N_LAYERS_PX, SIZE_FIRST_HIDDEN_LAYER_PX, MULTIPLIER_PX, LEAK_RATE_PX): - output_dir = "results/"+str(detector_version)+"/"+str(detector_config)+"/detector_benchmarks/roman_pots/ml/metadata" + output_dir = "results/"+str(detector_version)+"/"+str(detector_config)+"/detector_benchmarks/"+str(SUBSYSTEM)+"/"+str(BENCHMARK)+"/metadata" output_file = str(num_training_inputs)+"_"+\ str(num_epochs_pz)+"_"+str(learning_rate_pz)+"_"+str(size_input_pz)+"_"+str(size_output_pz)+"_"+str(n_layers_pz)+"_"+str(size_first_hidden_layer_pz)+"_"+str(multiplier_pz)+"_"+str(leak_rate_pz)+"_"+\ str(num_epochs_py)+"_"+str(learning_rate_py)+"_"+str(size_input_py)+"_"+str(size_output_py)+"_"+str(n_layers_py)+"_"+str(size_first_hidden_layer_py)+"_"+str(multiplier_py)+"_"+str(leak_rate_py)+"_"+\ str(num_epochs_px)+"_"+str(learning_rate_px)+"_"+str(size_input_px)+"_"+str(size_output_px)+"_"+str(n_layers_px)+"_"+str(size_first_hidden_layer_px)+"_"+str(multiplier_px)+"_"+str(leak_rate_px) - output_file_location = open(str(output_dir)+"/"+str(detector_version)+"_"+str(detector_config)+"_"+str(hashlib.sha512(output_file.encode()).hexdigest())+".txt","w") + output_file_location = open(str(output_dir)+"/"+str(detector_version)+"_"+str(detector_config)+"_"+str(SUBSYSTEM)+"_"+str(BENCHMARK)+"_"+str(hashlib.sha512(output_file.encode()).hexdigest())+".txt","w") output_file_location.write(output_file) print(output_file_location) output_file_location.close()