-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_experiments.py
29 lines (22 loc) · 894 Bytes
/
run_experiments.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
from src.config import EXPERIMENTS
from src.globals import DATA_DIR_PATH, RESULTS_CSV_FNAME
from src.initialize_experiments import initialize_experiments
def clean_dirs():
"""Remove all .md files and results csv from the data directory."""
for filename in os.listdir(DATA_DIR_PATH):
if filename.endswith(".md") or filename == RESULTS_CSV_FNAME:
os.remove(os.path.join(DATA_DIR_PATH, filename))
def run_experiments():
"""Run all experiments and report results."""
# clean_dirs()
experiments = initialize_experiments(EXPERIMENTS)
# TODO: Add optional multiprocessing?
for experiment in experiments:
try:
experiment.run()
experiment.report_results()
except Exception as e:
print(f"Error running experiment {experiment.name}: {e}")
if __name__ == "__main__":
run_experiments()