-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_pre.py
35 lines (31 loc) · 1.05 KB
/
run_pre.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
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: Yaoyao Liu
## Tianjin University
## Copyright (c) 2019
##
## 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.1, gamma=0.2, step_size=30):
max_epoch = 115
shot = 1
query = 15
way = 5
gpu = 2
base_lr = 0.01
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.1, gamma=0.2, step_size=30)