|
|
@ -18,19 +18,21 @@ job_plugin = studio.installed_plugins["jobs"] |
|
|
|
# do a sweep over learning rates |
|
|
|
|
|
|
|
# Define the ranges or sets of values for each hyperparameter |
|
|
|
alpha_values = list(np.round(np.linspace(2, 6, 41), 4)) |
|
|
|
alpha_values = list(np.round(np.linspace(2, 4, 21), 4)) |
|
|
|
# learning_rate_values = list(np.round(np.logspace(-5, -3, 41), 5)) |
|
|
|
learning_rate_values = [5e-4] |
|
|
|
batch_size_values = [64, 128] |
|
|
|
batch_size_values = [128] |
|
|
|
max_epochs_values = [500] |
|
|
|
seeds = list(range(21, 1992)) |
|
|
|
|
|
|
|
# Generate all possible combinations of hyperparameters |
|
|
|
all_params = [ |
|
|
|
(alpha, lr, bs, me) |
|
|
|
(alpha, lr, bs, me, s) |
|
|
|
for alpha in alpha_values |
|
|
|
for lr in learning_rate_values |
|
|
|
for bs in batch_size_values |
|
|
|
for me in max_epochs_values |
|
|
|
for s in seeds |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
@ -38,8 +40,8 @@ all_params = [ |
|
|
|
search_params = sample(all_params, min(NUM_JOBS, len(all_params))) |
|
|
|
|
|
|
|
for idx, params in enumerate(search_params): |
|
|
|
a, lr, bs, me = params |
|
|
|
cmd = f"cd ~/colors && python main.py --alpha {a} --lr {lr} --bs {bs} --max_epochs {me}" |
|
|
|
a, lr, bs, me, s = params |
|
|
|
cmd = f"cd ~/colors && python main.py --alpha {a} --lr {lr} --bs {bs} --max_epochs {me} --seed {s}" |
|
|
|
# job_name = f"color2_{bs}_{a}_{lr:2.2e}" |
|
|
|
# job_plugin.run(cmd, machine=Machine.T4, name=job_name) |
|
|
|
print(f"Running {params}: {cmd}") |
|
|
|