forked from phanein/deepwalk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·58 lines (53 loc) · 1.68 KB
/
run.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
#!/bin/bash
#
# \description Execution on multiple networks
#
# \author Artem V L <artem@exascale.info> https://exascale.info
DIMS=128
NETS="blogcatalog dblp homo wiki youtube"
WORKERS=8
RESTRACER=./exectime # time
LOGDIR=embeds/logs
mkdir -p $LOGDIR
USAGE="$0 -h | [-d <dimensions>=${DIMS}] [-w <workers>=${WORKERS}]
-d,--dims - required number of dimensions in the embedding model
-w,--workers - maximal number of workers (parallel thread). Note: deepwalk training can be failed on non-small datasets with small number of workers
-h,--help - help, show this usage description
Examples:
\$ $0 -d 128 -w 4
"
while [ $1 ]; do
case $1 in
-h|--help)
# Use defaults for the remained parameters
echo -e $USAGE # -e to interpret '\n\
exit 0
;;
-d|--dims)
if [ "${2::1}" == "-" ]; then
echo "ERROR, invalid argument value of $1: $2"
exit 1
fi
DIMS=$2
echo "Set $1: $2"
shift 2
;;
-w|--workers)
if [ "${2::1}" == "-" ]; then
echo "ERROR, invalid argument value of $1: $2"
exit 1
fi
WORKERS=$2
echo "Set $1: $2"
shift 2
;;
*)
printf "Error: Invalid option specified: $1 $2 ...\n\n$USAGE"
exit 1
;;
esac
done
for NET in $NETS; do
$RESTRACER python3 -m deepwalk --format mat --input graphs/${NET}.mat --number-walks 80 --representation-size ${DIMS} --walk-length 40 --window-size 10 --workers $WORKERS --output embeds/embs_${NET}_${DIMS}-n80-l40-s10.w2v > "$LOGDIR/${NET}_${DIMS}-n80-l40-s10.log" 2> "$LOGDIR/${NET}_${DIMS}-n80-l40-s10.err" # &
done
# python3 -m deepwalk --format mat --input example_graphs/blogcatalog.mat --number-walks 80 --representation-size 128 --walk-length 40 --window-size 10 --workers 1 --output example_graphs/blogcatalog.w2v