diff --git a/run_exp.py b/run_exp.py new file mode 100644 index 0000000000000000000000000000000000000000..2b13321492863f7b1b6685cadd96872ded872a58 --- /dev/null +++ b/run_exp.py @@ -0,0 +1,33 @@ +import csv +import subprocess + +# Path to your CSV file +csv_file = "exp_configs.csv" + +# Read the second line from the CSV file +with open(csv_file, newline='') as csvfile: + reader = csv.reader(csvfile) + + # Skip the header (if any) and the first row + next(reader) # Skipping the header + row = next(reader) # Reading the second row + + # Assigning CSV values to variables + exp_type, dataset, heterogeneity_type, num_clients, num_samples_by_label, num_clusters, centralized_epochs, federated_rounds, seed = row + + # Building the command + command = [ + "python", "driver.py", + "--exp_type", exp_type, + "--dataset", dataset, + "--heterogeneity_type", heterogeneity_type, + "--num_clients", num_clients, + "--num_samples_by_label", num_samples_by_label, + "--num_clusters", num_clusters, + "--centralized_epochs", centralized_epochs, + "--federated_rounds", federated_rounds, + "--seed", seed + ] + + # Run the command + subprocess.run(command)