-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvisualise_dataset.py
38 lines (29 loc) · 1.16 KB
/
visualise_dataset.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
36
37
38
from matplotlib import pyplot as plt
import numpy as np
from utils import get_split_graphset, get_split_dataset
if __name__ == '__main__':
index = 2
train_graphs, train_features, train_y, val_graphs, val_features, val_y, test_graphs, test_features, test_y = \
get_split_graphset('dataset/hela_100', 64, 1024, ['1'])
fig, ax = plt.subplots()
ax.matshow(train_graphs[index], cmap="YlOrBr", interpolation='none')
plt.sca(ax)
plt.axis('off')
plt.savefig('tmp/hela_graph.pdf')
fig, ax = plt.subplots()
ax.matshow(train_y[index], interpolation='none')
plt.sca(ax)
plt.axis('off')
plt.savefig('tmp/hela_y.pdf')
train_graphs, train_features, train_y, val_graphs, val_features, val_y, test_graphs, test_features, test_y = \
get_split_graphset('dataset/hela_100_no_label', 64, 1024, ['1'])
fig, ax = plt.subplots()
ax.matshow(train_graphs[index], cmap="YlOrBr", interpolation='none')
plt.sca(ax)
plt.axis('off')
plt.savefig('tmp/hela_pl_graph.pdf')
fig, ax = plt.subplots()
ax.matshow(train_y[index], interpolation='none')
plt.sca(ax)
plt.axis('off')
plt.savefig('tmp/hela_pl_y.pdf')