-
Notifications
You must be signed in to change notification settings - Fork 22
/
pipeline_mod_cpu.sh
147 lines (130 loc) · 4.46 KB
/
pipeline_mod_cpu.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
function do1round()
{
# $1: job name
# $2: seed
# $3: job round number
# $4: conv1 kernel
# $5: conv2 kernel
# $6: config.py
echo "##### job: "${1}" | seed: "${2}" | round: "$3" #####"
if [ ! -d ${1} ]; then
mkdir ${1}
fi
if [ ! -d ${1}"/"${2} ]; then
mkdir ${1}"/"${2}
fi
if [ ! -d ${1}"/"${2}"/"${3} ]; then
mkdir ${1}"/"${2}"/"${3}
fi
echo "train_path = 'data/"${1}"_train_"${2}".txt'" > ${6} # 1
echo "test_path = 'data/"${1}"_test_"${2}".txt' " >> ${6} # 2
echo "result_path = 'work/"${1}"_pred_"${2}"_"${3}".txt'" >> ${6} # 3
echo "log_path = 'work/"${1}"_"${2}"_"${3}".log'" >> ${6} # 4
echo "save_prefix = 'work/"${1}"/"${2}"/"${3}"'" >> ${6} # 5
echo "pretrain_path = ''" >> ${6} # 6
echo "dict_path = ''" >> ${6} # 7
echo "" >> ${6}
echo "conv1_kernel = "${4} >> ${6} # 8
echo "conv2_kernel = "${5} >> ${6} # 9
# these params won't change for mod data:
echo "min_rt = 0" >> ${6}
echo "max_rt = 110" >> ${6}
echo "time_scale = 60" >> ${6}
echo "max_length = 50" >> ${6}
cd ..
python capsule_network_emb_cpu.py # using CPU version
cd work
}
function ensemble1sed
{
# scale = argv[1]
# round1dir = argv[2] # 'work/dia/59/1/'
# conv1 = argv[3]
# round2dir = argv[4] # 'work/dia/59/2/'
# conv2 = argv[5]
# round3dir = argv[6] # 'work/dia/59/3/'
# conv3 = argv[7]
# result_ensemble = argv[8]
round1dir="work/"${1}"/"${2}"/"${3}"/"
conv1=${4}
round2dir="work/"${1}"/"${2}"/"${5}"/"
conv2=${6}
round3dir="work/"${1}"/"${2}"/"${7}"/"
conv3=${8}
result="work/"${1}"_notrans_"${2}"_ensemble.txt" # Note thies mark
cd ..
# $9 -> minrt, ${10} -> maxrt
# using CPU version:
python ensemble_emb_cpu.py $9 $round1dir $conv1 $round2dir $conv2 $round3dir $conv3 $result ${10} > "work/"${1}"_notrans_"${2}"_ensemble.log"
cd work
}
echo "job no.1/10"
do1round "mod" 2 1 8 8 "../config.py"
do1round "mod" 2 2 10 10 "../config.py"
do1round "mod" 2 3 12 12 "../config.py"
echo "ensemble 3 rounds, 5 epochs each"
ensemble1sed "mod" 2 '1' 8 '2' 10 '3' 12 0 110
echo -e "done\n"
# echo "job no.2/10"
# do1round "mod" 313 1 8 8 "../config.py"
# do1round "mod" 313 2 10 10 "../config.py"
# do1round "mod" 313 3 12 12 "../config.py"
# echo "ensemble 3 rounds, 5 epochs each"
# ensemble1sed "mod" 313 '1' 8 '2' 10 '3' 12 0 110
# echo -e "done\n"
# echo "job no.3/10"
# do1round "mod" 23 1 8 8 "../config.py"
# do1round "mod" 23 2 10 10 "../config.py"
# do1round "mod" 23 3 12 12 "../config.py"
# echo "ensemble 3 rounds, 5 epochs each"
# ensemble1sed "mod" 23 '1' 8 '2' 10 '3' 12 0 110
# echo -e "done\n"
# echo "job no.4/10"
# do1round "mod" 59 1 8 8 "../config.py"
# do1round "mod" 59 2 10 10 "../config.py"
# do1round "mod" 59 3 12 12 "../config.py"
# echo "ensemble 3 rounds, 5 epochs each"
# ensemble1sed "mod" 59 '1' 8 '2' 10 '3' 12 0 110
# echo -e "done\n"
# echo "job no.5/10"
# do1round "mod" 97 1 8 8 "../config.py"
# do1round "mod" 97 2 10 10 "../config.py"
# do1round "mod" 97 3 12 12 "../config.py"
# echo "ensemble 3 rounds, 5 epochs each"
# ensemble1sed "mod" 97 '1' 8 '2' 10 '3' 12 0 110
# echo -e "done\n"
# echo "job no.6/10"
# do1round "mod" 137 1 8 8 "../config.py"
# do1round "mod" 137 2 10 10 "../config.py"
# do1round "mod" 137 3 12 12 "../config.py"
# echo "ensemble 3 rounds, 5 epochs each"
# ensemble1sed "mod" 137 '1' 8 '2' 10 '3' 12 0 110
# echo -e "done\n"
# echo "job no.7/10"
# do1round "mod" 179 1 8 8 "../config.py"
# do1round "mod" 179 2 10 10 "../config.py"
# do1round "mod" 179 3 12 12 "../config.py"
# echo "ensemble 3 rounds, 5 epochs each"
# ensemble1sed "mod" 179 '1' 8 '2' 10 '3' 12 0 110
# echo -e "done\n"
# echo "job no.8/10"
# do1round "mod" 227 1 8 8 "../config.py"
# do1round "mod" 227 2 10 10 "../config.py"
# do1round "mod" 227 3 12 12 "../config.py"
# echo "ensemble 3 rounds, 5 epochs each"
# ensemble1sed "mod" 227 '1' 8 '2' 10 '3' 12 0 110
# echo -e "done\n"
# echo "job no.9/10"
# do1round "mod" 269 1 8 8 "../config.py"
# do1round "mod" 269 2 10 10 "../config.py"
# do1round "mod" 269 3 12 12 "../config.py"
# echo "ensemble 3 rounds, 5 epochs each"
# ensemble1sed "mod" 269 '1' 8 '2' 10 '3' 12 0 110
# echo -e "done\n"
# echo "job no.10/10"
# do1round "mod" 367 1 8 8 "../config.py"
# do1round "mod" 367 2 10 10 "../config.py"
# do1round "mod" 367 3 12 12 "../config.py"
# echo "ensemble 3 rounds, 5 epochs each"
# ensemble1sed "mod" 367 '1' 8 '2' 10 '3' 12 0 110
# echo -e "done\n"