forked from tiehangd/MUPS-EEG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pre_train.py
34 lines (28 loc) · 1.04 KB
/
pre_train.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
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Modified from: https://github.com/yaoyao-liu/meta-transfer-learning
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root directory of this source tree
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
""" Generate commands for pre-train phase. """
import os
def run_exp(lr=0.05, gamma=0.5, step_size=20):
max_epoch = 10
shot = 20
query = 10
way = 4
gpu = 0
base_lr = 0.005
the_command = 'python3 main.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) \
+ ' --phase=pre_train'
os.system(the_command)
run_exp(lr=0.05, gamma=0.5, step_size=20)