|
| 1 | +import random |
| 2 | +n_experiments = 5 |
| 3 | +seeds = [] |
| 4 | +for i in range(n_experiments): |
| 5 | + seeds.append(random.randint(0, 100)) |
| 6 | + |
| 7 | +seeds = [22, 92, 54, 86, 41] |
| 8 | +seeds = [22] |
| 9 | +config_paths = [ |
| 10 | + "sample_configs/paper_image_cloud_configs.yaml", |
| 11 | + "sample_configs/paper_text_tabular_cloud_configs.yaml", |
| 12 | + "sample_configs/paper_text_cloud_configs.yaml", |
| 13 | +<<<<<<< HEAD |
| 14 | +======= |
| 15 | +] |
| 16 | +frameworks = [ |
| 17 | + # "AutoGluon_best_master", |
| 18 | + # "autokeras_master", |
| 19 | + "ablation_base", |
| 20 | + "ablation_greedy_soup", |
| 21 | + "ablation_gradient_clip", |
| 22 | + "ablation_warmup_steps", |
| 23 | + # "ablation_cosine_decay", |
| 24 | + # "ablation_weight_decay", |
| 25 | + # "ablation_lr_decay", |
| 26 | + |
| 27 | +>>>>>>> 8bc504afe4a26167224ad4740a87db9844e25494 |
| 28 | +] |
| 29 | +frameworks = ['AutoGluon_best_master', 'ablation_base', 'ablation_add_greedy', 'ablation_add_grad_clip', 'ablation_add_warmup_steps', 'ablation_add_cosine_decay', 'ablation_add_weight_decay', 'ablation_add_lr_decay', 'AutoGluon_del_greedy', 'AutoGluon_del_grad_clip', 'AutoGluon_del_warmup_steps', 'AutoGluon_del_cosine_decay', 'AutoGluon_del_weight_decay', 'AutoGluon_del_lr_decay'] |
| 30 | + |
| 31 | +#frameworks = [ |
| 32 | + # "ablation_base", |
| 33 | + # "ablation_greedy_soup", |
| 34 | + # "ablation_gradient_clip", |
| 35 | + # "ablation_warmup_steps", |
| 36 | + # "ablation_cosine_decay", |
| 37 | + # "ablation_weight_decay", |
| 38 | + # "ablation_lr_decay", |
| 39 | +# "autokeras_master", |
| 40 | +#] |
| 41 | +constraints = [ |
| 42 | + "g4_12x" |
| 43 | +] |
| 44 | +# module = "autokeras" |
| 45 | +module = "multimodal" |
| 46 | + |
| 47 | +import yaml |
| 48 | +import os |
| 49 | +import subprocess |
| 50 | + |
| 51 | +config_root = "./temp_configs" |
| 52 | +os.makedirs(config_root, exist_ok=True) |
| 53 | + |
| 54 | +for seed in seeds: |
| 55 | + print("Seed: ", seed) |
| 56 | + for constraint in constraints: |
| 57 | + os.makedirs(f"{config_root}/{constraint}", exist_ok=True) |
| 58 | + for framework in frameworks: |
| 59 | + # for shot in fs: |
| 60 | + config_dir = f"{config_root}/{constraint}/{framework}" |
| 61 | + os.makedirs(config_dir, exist_ok=True) |
| 62 | + |
| 63 | + for config_path in config_paths: |
| 64 | + with open(config_path, "r") as f: |
| 65 | + configs = yaml.safe_load(f) |
| 66 | + if constraint == "g4_12x": |
| 67 | + configs["cdk_context"]["PREFIX"] = f"{configs['cdk_context']['PREFIX']}-multi" |
| 68 | + configs["constraint"] = constraint |
| 69 | + configs["framework"] = framework |
| 70 | + configs["module"] = module |
| 71 | + configs["seed"] = seed |
| 72 | + # configs["custom_dataloader"]["shot"] = shot |
| 73 | + configs["benchmark_name"] = f"{configs['benchmark_name']}-{seed}" |
| 74 | + new_config_path = os.path.join(config_dir, os.path.basename(config_path)) |
| 75 | + with open(new_config_path, "w") as new_f: |
| 76 | + yaml.dump(configs, new_f) |
| 77 | + print("Running config: ", new_config_path) |
| 78 | + command = ["agbench", "run", new_config_path] |
| 79 | + subprocess.run(command) |
| 80 | + |
0 commit comments