-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_predicion_cnn.sh
More file actions
executable file
·50 lines (41 loc) · 1.51 KB
/
make_predicion_cnn.sh
File metadata and controls
executable file
·50 lines (41 loc) · 1.51 KB
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
#!/bin/bash
# code for test AI
# Usage: make_prediction.sh [DIR where AI saved] [keyword of AI] [keyword of dataset]
# 20180413 version alpha 1
# The code work
# 20180425 version alpha 2
# Set keyword of AI and keyword of dataset respectively.
# 20180529 version alpha 3
# Using main name to replace the keywords, and the fucntions become more flexible.
# check arguments
if [ "$#" -ne 3 ]; then
echo "Illegal number of parameters"
echo "Usage: ${0##*/} [DIR where AI saved] [main name of AI] [main name of dataset]"
echo "Example: ${0##*/} . spitzer spitzer"
exit 1
fi
# Initialize the format of your datasets.
sed_test_cnn.py
vim option_test.txt
# Initialize variables
AI_POOL=${1}
main_name_model=${2}
main_name_set=${3}
echo "AI saved directory going to test:"
for each in ${AI_POOL}/20*/;
do
# ${each##*/} means only take the last word of $each
# ${each::-1} means take $each but the last latter.
FULL_AI_NAME=${each:0:${#each} - 1}
AI_NAME=${FULL_AI_NAME##*/}
echo "##############"
echo "AI under test: ${AI_NAME}"
# create a directory to save result of testing
mkdir -p "AI_${AI_NAME}_test_on_${main_name_set}"
sed_test_cnn.py option_test.txt \
${main_name_set}_sed.txt ${main_name_set}_c2d2007_Sp.txt ${main_name_set}_coord.txt \
"AI_${AI_NAME}_test_on_${main_name_set}"\
"${each}checkpoint_AI_64_8_${main_name_model}_sed" \
> "AI_${AI_NAME}_test_on_${main_name_set}/result_of_AI_test"
done
exit 0