Skip to content

Commit

Permalink
Parametrise subsystem and model type for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
rahmans1 committed Jan 19, 2024
1 parent 130ff48 commit 08fa4c5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions benchmarks/roman_pots/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit 08fa4c5

Please sign in to comment.