in src/utils.py [0:0]
def get_dump_path(params):
"""
Create a directory to store the experiment.
"""
assert os.path.isdir(MODELS_PATH)
# create the sweep path if it does not exist
sweep_path = os.path.join(MODELS_PATH, params.name)
if not os.path.exists(sweep_path):
subprocess.Popen("mkdir %s" % sweep_path, shell=True).wait()
# create a random name for the experiment
chars = 'abcdefghijklmnopqrstuvwxyz0123456789'
while True:
exp_id = ''.join(random.choice(chars) for _ in range(10))
dump_path = os.path.join(MODELS_PATH, params.name, exp_id)
if not os.path.isdir(dump_path):
break
# create the dump folder
if not os.path.isdir(dump_path):
subprocess.Popen("mkdir %s" % dump_path, shell=True).wait()
return dump_path