forked from HongyangGao/Graph-U-Nets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_GNN.sh
executable file
·48 lines (43 loc) · 1.21 KB
/
run_GNN.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
#!/bin/bash
DATA="${1-DD}"
fold=${2-1} # 0 for 10-fold
GPU=${3-0}
seed=1
CONFIG=configs/${DATA}
if [ ! -f "$CONFIG" ]; then
echo "No config file for ${DATA} in configs folder"
exit 128
fi
source configs/${DATA}
FOLDER=results
FILE=${FOLDER}/${DATA}.txt
if [ ! -d "$FOLDER" ]; then
mkdir $FOLDER
fi
run(){
CUDA_VISIBLE_DEVICES=${GPU} python3 src/main.py \
-seed $seed -data $DATA -fold $1 -num_epochs $num_epochs \
-batch $batch_size -lr $learning_rate -deg_as_tag $deg_as_tag \
-l_num $layer_num -h_dim $hidden_dim -l_dim $layer_dim \
-drop_n $drop_network -drop_c $drop_classifier \
-act_n $activation_network -act_c $activation_classifier \
-ks $pool_rates_layers -acc_file $FILE
}
if [ ${fold} == 0 ]; then
if [ -f "$FILE" ]; then
rm $FILE
fi
echo "Running 10-fold cross validation"
start=`date +%s`
run $fold
stop=`date +%s`
echo "End of cross-validation using $[stop - start] seconds"
echo "The accuracy results for ${DATA} are as follows:"
cat $FILE
echo "Mean and sstdev are:"
cat $FILE | datamash mean 2 sstdev 2
else
run $fold
echo "The accuracy result for ${DATA} fold ${fold} is:"
tail -1 $FILE
fi