|
@ -5,7 +5,7 @@ from random import sample |
|
|
import numpy as np # noqa: F401 |
|
|
import numpy as np # noqa: F401 |
|
|
from lightning_sdk import Machine, Studio # noqa: F401 |
|
|
from lightning_sdk import Machine, Studio # noqa: F401 |
|
|
|
|
|
|
|
|
NUM_JOBS = 100 |
|
|
NUM_JOBS = 500 |
|
|
|
|
|
|
|
|
# reference to the current studio |
|
|
# reference to the current studio |
|
|
# if you run outside of Lightning, you can pass the Studio name |
|
|
# if you run outside of Lightning, you can pass the Studio name |
|
@ -23,6 +23,7 @@ NUM_JOBS = 100 |
|
|
learning_rate_values = [1e-2] |
|
|
learning_rate_values = [1e-2] |
|
|
alpha_values = [0] |
|
|
alpha_values = [0] |
|
|
widths = [2**k for k in range(4, 15)] |
|
|
widths = [2**k for k in range(4, 15)] |
|
|
|
|
|
depths = [1, 2, 4, 8, 16] |
|
|
# learning_rate_values = [5e-4] |
|
|
# learning_rate_values = [5e-4] |
|
|
batch_size_values = [256] |
|
|
batch_size_values = [256] |
|
|
max_epochs_values = [100] |
|
|
max_epochs_values = [100] |
|
@ -35,18 +36,18 @@ optimizers = [ |
|
|
"LBFGS", |
|
|
"LBFGS", |
|
|
"RAdam", |
|
|
"RAdam", |
|
|
"RMSprop", |
|
|
"RMSprop", |
|
|
"SparseAdam", |
|
|
|
|
|
"Adadelta", |
|
|
"Adadelta", |
|
|
] |
|
|
] |
|
|
# Generate all possible combinations of hyperparameters |
|
|
# Generate all possible combinations of hyperparameters |
|
|
all_params = [ |
|
|
all_params = [ |
|
|
(alpha, lr, bs, me, s, w, opt) |
|
|
(alpha, lr, bs, me, s, w, d, opt) |
|
|
for alpha in alpha_values |
|
|
for alpha in alpha_values |
|
|
for lr in learning_rate_values |
|
|
for lr in learning_rate_values |
|
|
for bs in batch_size_values |
|
|
for bs in batch_size_values |
|
|
for me in max_epochs_values |
|
|
for me in max_epochs_values |
|
|
for s in seeds |
|
|
for s in seeds |
|
|
for w in widths |
|
|
for w in widths |
|
|
|
|
|
for d in depths |
|
|
for opt in optimizers |
|
|
for opt in optimizers |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
@ -55,7 +56,7 @@ all_params = [ |
|
|
search_params = sample(all_params, min(NUM_JOBS, len(all_params))) |
|
|
search_params = sample(all_params, min(NUM_JOBS, len(all_params))) |
|
|
|
|
|
|
|
|
for idx, params in enumerate(search_params): |
|
|
for idx, params in enumerate(search_params): |
|
|
a, lr, bs, me, s, w, opt = params |
|
|
a, lr, bs, me, s, w, d, opt = params |
|
|
# cmd = f"cd ~/colors && python main.py --alpha {a} --lr {lr} --bs {bs} --max_epochs {me} --seed {s} --width {w}" |
|
|
# cmd = f"cd ~/colors && python main.py --alpha {a} --lr {lr} --bs {bs} --max_epochs {me} --seed {s} --width {w}" |
|
|
cmd = f""" |
|
|
cmd = f""" |
|
|
python newmain.py fit \ |
|
|
python newmain.py fit \ |
|
@ -65,7 +66,7 @@ python newmain.py fit \ |
|
|
--data.val_size 100000 \ |
|
|
--data.val_size 100000 \ |
|
|
--model.alpha {a} \ |
|
|
--model.alpha {a} \ |
|
|
--model.width {w} \ |
|
|
--model.width {w} \ |
|
|
--model.depth 1 \ |
|
|
--model.depth {d} \ |
|
|
--trainer.min_epochs 10 \ |
|
|
--trainer.min_epochs 10 \ |
|
|
--trainer.max_epochs {me} \ |
|
|
--trainer.max_epochs {me} \ |
|
|
--trainer.log_every_n_steps 3 \ |
|
|
--trainer.log_every_n_steps 3 \ |
|
@ -96,3 +97,5 @@ python newmain.py fit \ |
|
|
except KeyboardInterrupt: |
|
|
except KeyboardInterrupt: |
|
|
print("Interrupted by user") |
|
|
print("Interrupted by user") |
|
|
sys.exit(1) |
|
|
sys.exit(1) |
|
|
|
|
|
# except subprocess.CalledProcessError: |
|
|
|
|
|
# pass |
|
|