-
Notifications
You must be signed in to change notification settings - Fork 5
/
mix_train_search_retrain.py
38 lines (31 loc) · 1.34 KB
/
mix_train_search_retrain.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
""" Generate commands for pre-train phase. """
import os
def run_exp(lr=0.05, gamma=0.5, step_size=20, pre_batch_size=8):
max_epoch = 240
shot = 20
query = 10
way = 4
gpu = 3
base_lr = 0.01
weight_lr=0.02
alpha_lr=0.01
searched_structure_path = '/data00/home/xx/BCI/Mudus/Mudus_BCI/logs/normal_search/BCI_IV_Search_batchsize32_w_lr0.01_alpha_lr0.005_gamma0.5_step20_maxepoch240_Mix_Search_Formal_4_val_node_2_layer4_new_search_space_with_skip_Elu_flattennoadapp/max_acc.pth'
the_command = 'python3 lauch.py' \
+ ' --pre_max_epoch=' + str(max_epoch) \
+ ' --shot=' + str(shot) \
+ ' --train_query=' + str(query) \
+ ' --way=' + str(way) \
+ ' --pre_step_size=' + str(step_size) \
+ ' --pre_gamma=' + str(gamma) \
+ ' --gpu=' + str(gpu) \
+ ' --base_lr=' + str(base_lr) \
+ ' --pre_lr=' + str(lr) \
+ ' --pre_batch_size=' + str(pre_batch_size) \
+ ' --searched_weights=' + str(searched_structure_path) \
+ ' --phase=dependent' \
+ ' --model_type=Search_retrain' \
+ ' --exp_spc=current_best_retrain_argmax_drop_prob_0_subject_all_exp2' \
+ ' --w_lr=' + str(weight_lr) \
+ ' --alpha_lr=' + str(alpha_lr)
os.system(the_command)
run_exp(lr=0.01, gamma=0.5, step_size=20, pre_batch_size=256)