Skip to content

Commit

Permalink
Truncate the hash to first 6 hexdigits. 6 hexdigits is equivalent to …
Browse files Browse the repository at this point in the history
…6*4=24 bits. The number of unique hashes that we can generate before the probability of hash collision between any 2 model hashes reaches 50% is sqrt(2*0.5*2^(24))=4096. We are unlikely to run training over hyperparameter space that large on a single iteration.
  • Loading branch information
rahmans1 committed Jan 22, 2024
1 parent 08fa4c5 commit 2cbb87e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions benchmarks/roman_pots/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ N_LAYERS_PX = [10]
SIZE_FIRST_HIDDEN_LAYER_PX = [10]
MULTIPLIER_PX = [10]
LEAK_RATE_PX = [0.025]
MAX_HASH = 6
MODEL_VERSION = [
hashlib.sha512("_".join(map(str,x)).encode()).hexdigest()
hashlib.sha512("_".join(map(str,x)).encode()).hexdigest()[:MAX_HASH]
for x in product(
NUM_TRAINING_INPUTS,
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,
Expand Down Expand Up @@ -70,7 +71,7 @@ rule roman_pots_generate_neural_network_configs:
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(SUBSYSTEM)+"_"+str(BENCHMARK)+"_"+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()[:MAX_HASH])+".txt","w")
output_file_location.write(output_file)
print(output_file_location)
output_file_location.close()
Expand Down

0 comments on commit 2cbb87e

Please sign in to comment.