-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_all.py
35 lines (30 loc) · 977 Bytes
/
run_all.py
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
import csv
import datetime
import gat
import gcn
import graphsage
dataset = ['Cora', 'CiteSeer', 'Photo', 'cs', 'Computers', 'CoraFull']
spt = [1, 3, 5]
time_now = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
f = open('output/gnns-fw-' + str(time_now) + '.csv', 'w', encoding='utf-8', newline="")
csv_writer = csv.writer(f)
csv_writer.writerow(['', 'models/shot/datasets', ] + dataset)
for i in spt:
gcn_acc = ['gcn', i]
for dataset_p in dataset:
gcn_mean_var = gcn.main(dataset_p, i)
gcn_acc.append(gcn_mean_var)
csv_writer.writerow(gcn_acc)
for i in spt:
gat_acc = ['gat', i]
for dataset_p in dataset:
gat_mean_var = gat.main(dataset_p, i)
gat_acc.append(gat_mean_var)
csv_writer.writerow(gat_acc)
for i in spt:
sage_acc = ['sage', i]
for dataset_p in dataset:
sage_mean_var = graphsage.main(dataset_p, i)
sage_acc.append(sage_mean_var)
csv_writer.writerow(sage_acc)
f.close()