-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_all.py
27 lines (22 loc) · 957 Bytes
/
run_all.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
import argparse
import os
import sys
def get_arguments():
parser = argparse.ArgumentParser(description='Runner File')
parser.add_argument('-model', action="store", default="no_features", dest="model", type=str)
parser.add_argument('-num_threads', action='store', default=2, dest='num_threads', type=int)
opts = parser.parse_args(sys.argv[1:])
return opts
if __name__ == "__main__":
args = get_arguments()
for thread_ix in range(args.num_threads):
command = 'python BiLSTM.py'
command += ' -train_flag True'
command += ' -model ' + args.model
command += ' -thread_ix ' + str(thread_ix)
command += ' -num_threads ' + str(args.num_threads)
command += ' -use_partial True'
log_file = 'logger_' + str(thread_ix) + '.log'
error_file = 'errlogger_' + str(thread_ix) + '.log'
command += ' > ' + log_file + ' 2> ' + error_file
os.system(command + ' &')