Hello,
I’m still very new to the topic of deep learning on graphs. Given a directed weighted graph, the objective is to perform binary classification of the graph’s edges.
Any pointers to resolve the following issues are much appreciated.
- I already implemented a function which loads the graphs into a batch. Is the implementation correct or am I missing some details. The constructs each graph with each edge weight and edge label. There are no known node features. Finally, all graphs are added to a graph batch
def read_graphs(path):
graphs = []
for file_path in glob.iglob(path):
g = dgl.DGLGraph()
with open(file_path) as file:
u, v, f = [], [], []
w, labels, = [], []
labels_2d = [line.split() for line in open(label_file_path)]
for line in file:
l = line.split()
if l[0] != l[1]:
u.append(int(l[0]))
v.append(int(l[1]))
w.append(float(l[2]))
labels.append(int(labels_2d[int(l[0])][int(l[1])]))
g.add_edges(torch.tensor(u), torch.tensor(v),
{'weight': torch.tensor(w), 'label': torch.tensor(labels)})
graphs.append(g)
return graphs
graphs = read_graphs(path)
batch_graph = dgl.batch(graphs)
-
Is it possible to perform training on several batches instead of a single bath which contains all graphs?
-
Which model should I be using for the problem described, and how do I use the dataset to be fed into a model?
Thanks in advance