""" path = os.path.join(root_path, generate_tracking_tag(tracking_vars)) return path class InvalidConfigurationException(BaseException): """Exception""" pass if __name__ == "__main__": multiprocessing.set_start_method("fork") cfg: Config = Config() parser = ArgumentParser() merge_cfg_with_cli(cfg, parser) runner_args = RunnerCfg() args = parser.parse_args() hparams = ["sigma"] sweep_root_path = generate_sweep_path(Experiment) # this is specific to the jean-zay cluster if args.mp_method == "SLURM": sweep_root_path = os.path.join(os.path.expandvars("$SCRATCH"), sweep_root_path) processes = [] sweeper = Sweeper(grid_vars=hparams,
import argparse import importlib import os import sys from functions import create_exp_name_and_datetime_path, merge_cfg_with_cli, run from human_id import generate_id if __name__ == "__main__": # parser = argparse.ArgumentParser() exp = sys.argv[1].split("/")[-1].split(".")[0] module = importlib.import_module("." + exp, package="experiments") Experiment = getattr(module, "Experiment") cfg = getattr(module, "Config") parser = merge_cfg_with_cli(cfg) parser.add_argument("exp") args = parser.parse_args() path = create_exp_name_and_datetime_path(Experiment) path = os.path.join("results", path) args.run_id = generate_id() run(Experiment, args, path)