-
Notifications
You must be signed in to change notification settings - Fork 0
/
TRAIN_TEST_loop.sh
executable file
·90 lines (73 loc) · 3.81 KB
/
TRAIN_TEST_loop.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
#!/bin/bash
RND="777"
BATCH="64"
LR="0.0010" # Must be a %.04f FORMAT!
PATIENCE="5"
IMPROVEMENT="0.0005"
# =================================================================
# =================================================================
# =================================================================
source /opt/anaconda/etc/profile.d/conda.sh # SERRA
conda activate sometools_SBupdated
# =================================================================
# =================================================================
# =================================================================
TRAINDATA="INSTANCE"
TESTDATA_INDOMAIN="INSTANCE"
TESTDATA_CROSSDOMAIN="ETHZ"
SIZES=("NANO3" "NANO2" "NANO1" "NANO" "MICRO" "TINY" "SMALL" "MEDIUM" "LARGE") # INSTANCE
EPOCHS=("100" "100" "100" "100" "100" "100" "100" "100" "100") # INSTANCE
# TRAINDATA="ETHZ"
# TESTDATA_INDOMAIN="ETHZ"
# TESTDATA_CROSSDOMAIN="INSTANCE"
# SIZES=("NANO3" "NANO2" "NANO1" "NANO" "MICRO" "TINY") # ETHZ
# EPOCHS=("100" "100" "100" "100" "100" "100") # ETHZ
# Loop over the array
length=${#SIZES[@]} # Get the length of the array
for ((i=0; i<length; i++)); do
DATASIZE=${SIZES[i]}
EPOCHSNUM=${EPOCHS[i]}
echo ""
echo ""
echo "... Working with ---> ${TRAINDATA} / ${DATASIZE} - ${EPOCHSNUM} Epochs"
echo ""
echo "... Training DKPN"
./ReTrain_DKPN.py -d ${TRAINDATA} -s ${DATASIZE} -r ${RND} \
-e ${EPOCHSNUM} -b ${BATCH} -l ${LR} \
-o DKPN_TrainDataset_${TRAINDATA}_Size_${DATASIZE}_Rnd_${RND}_LR_${LR}_Batch_${BATCH} \
--early_stop -x ${PATIENCE} -y ${IMPROVEMENT}
echo ""
echo "... Training PhaseNet"
./ReTrain_PN.py -d ${TRAINDATA} -s ${DATASIZE} -r ${RND} \
-e ${EPOCHSNUM} -b ${BATCH} -l ${LR} \
-o PN_TrainDataset_${TRAINDATA}_Size_${DATASIZE}_Rnd_${RND}_LR_${LR}_Batch_${BATCH} \
--early_stop -x ${PATIENCE} -y ${IMPROVEMENT}
# --- In-Domain TEST
echo ""
echo "... Test IN-DOMAIN"
./LoadEvaluate_DKPN.py -k DKPN_TrainDataset_${TRAINDATA}_Size_${DATASIZE}_Rnd_${RND}_LR_${LR}_Batch_${BATCH} \
-p PN_TrainDataset_${TRAINDATA}_Size_${DATASIZE}_Rnd_${RND}_LR_${LR}_Batch_${BATCH} \
-d ${TESTDATA_INDOMAIN} -s ${DATASIZE} \
-x 0.2 -y 0.2 -n 5000 -f 10 -a 10 -b 20 \
-o Results_${TRAINDATA}_${TRAINDATA}_${DATASIZE}_02
./LoadEvaluate_DKPN.py -k DKPN_TrainDataset_${TRAINDATA}_Size_${DATASIZE}_Rnd_${RND}_LR_${LR}_Batch_${BATCH} \
-p PN_TrainDataset_${TRAINDATA}_Size_${DATASIZE}_Rnd_${RND}_LR_${LR}_Batch_${BATCH} \
-d ${TESTDATA_INDOMAIN} -s ${DATASIZE} \
-x 0.5 -y 0.5 -n 5000 -f 10 -a 10 -b 20 \
-o Results_${TRAINDATA}_${TRAINDATA}_${DATASIZE}_05
# --- Cross-Domain TEST
echo ""
echo "... Test CROSS-DOMAIN"
./LoadEvaluate_DKPN.py -k DKPN_TrainDataset_${TRAINDATA}_Size_${DATASIZE}_Rnd_${RND}_LR_${LR}_Batch_${BATCH} \
-p PN_TrainDataset_${TRAINDATA}_Size_${DATASIZE}_Rnd_${RND}_LR_${LR}_Batch_${BATCH} \
-d ${TESTDATA_CROSSDOMAIN} -s ${DATASIZE} \
-x 0.2 -y 0.2 -n 5000 -f 10 -a 10 -b 20 \
-o Results_${TRAINDATA}_${TESTDATA_CROSSDOMAIN}_${DATASIZE}_02
./LoadEvaluate_DKPN.py -k DKPN_TrainDataset_${TRAINDATA}_Size_${DATASIZE}_Rnd_${RND}_LR_${LR}_Batch_${BATCH} \
-p PN_TrainDataset_${TRAINDATA}_Size_${DATASIZE}_Rnd_${RND}_LR_${LR}_Batch_${BATCH} \
-d ${TESTDATA_CROSSDOMAIN} -s ${DATASIZE} \
-x 0.5 -y 0.5 -n 5000 -f 10 -a 10 -b 20 \
-o Results_${TRAINDATA}_${TESTDATA_CROSSDOMAIN}_${DATASIZE}_05
done
echo ""
echo "DONE!"