forked from BCV-Uniandes/AUNets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.sh
executable file
·109 lines (105 loc) · 2.75 KB
/
main.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
#!/usr/bin/env bash
#USE: ./main.sh -AU 1 -gpu 0 -fold 0
while [[ $# -gt 1 ]]
do
key="$1"
case $key in
-mode_data|--mode_data)
mode="$2"
shift # past argument
;;
-DEMO|--DEMO)
DEMO="$2"
shift # past argument
;;
-AU|-au|--AU|--au)
declare -a AU=( "$2" )
shift # past argument
;;
-gpu|--gpu|-GPU|--GPU)
gpu_id="$2"
shift # past argument
;;
-OF|--OF)
OF="$2"
shift # past argument
;;
-fold|--fold)
declare -a fold=( "$2" )
shift # past argument
;;
-finetuning|--finetuning)
declare -a finetuning=( "$2" )
shift # past argument
;;
-HYDRA|--HYDRA)
HYDRA=true
shift # past argument
;;
-DELETE|--DELETE)
DELETE=true
shift # past argument
;;
-TEST|--TEST)
TEST=true
shift # past argument
;;
-TEST_TXT|--TEST_TXT)
TEST_TXT=true
shift # past argument
;;
-TEST_PTH|--TEST_PTH)
TEST_PTH=true
shift # past argument
;;
*)
esac
shift # past argument or value
done
if [ -z ${OF+x} ]; then OF="None"; fi
if [ -z ${mode_data+x} ]; then mode_data="normal"; fi
if [ -z ${DEMO+x} ]; then DEMO=""; fi
if [ -z ${AU+x} ]; then declare -a AU=(1 2 4 6 7 10 12 14 15 17 23 24); fi
if [ -z ${finetuning+x} ]; then declare -a finetuning=("emotionnet"); fi
if [ -z ${fold+x} ]; then declare -a fold=( 0 1 2 ); fi
if [ -z ${HYDRA+x} ]; then HYDRA=false; fi
if [ -z ${DELETE+x} ]; then DELETE=false; fi
if [ -z ${TEST+x} ]; then TEST=false; fi
if [ -z ${TEST_TXT+x} ]; then TEST_TXT=false; fi
if [ -z ${TEST_PTH+x} ]; then TEST_PTH=false; fi
if [ $OF = "None" ] || [ $OF = "Alone" ]; then
batch_size=117
elif [ $OF = "Horizontal" ] || [ $OF = "Vertical" ]; then
batch_size=24
else
if [ $OF = "Channels" ]; then
batch_size=118
elif [ $OF = "Conv" ]; then
batch_size=34
else
if [ $OF = "FC6" ]; then
batch_size=42
elif [ $OF = "FC7" ]; then
batch_size=42
fi
fi
fi
for enc in "${finetuning[@]}"
do
for _fold in "${fold[@]}"
do
for au in "${AU[@]}"
do
command_train="./main.py -- --AU=$au --fold=$_fold --GPU=$gpu_id --OF $OF --DEMO $DEMO \
--batch_size=$batch_size --finetuning=$enc --mode_data=$mode_data"
if [ "$HYDRA" = true ]; then command_train+=" --HYDRA"; fi
if [ "$DELETE" = true ]; then command_train+=" --DELETE"; fi
if [ "$TEST" = true ]; then command_train+=" --mode test"; fi
if [ "$TEST_TXT" = true ]; then command_train+=" --mode test --TEST_TXT"; fi
if [ "$TEST_PTH" = true ]; then command_train+=" --mode test --TEST_PTH"; fi
echo $command_train
eval $command_train
echo ""
done
done
done