I am trying to use a series of GATlayers to connect a series of unidirectional bipartite graphs. My graph looks like a binary tree where each layer is an edge type and the edges flow up to the root.
4nodesTypeA → 2nodesTypeB → 1nodeTypeC
data_dict = {}
data_dict[('A', 'L0', 'B')] = ([],[])
data_dict[('B', 'L1', 'C')] = ([],[])
num_nodes_dict = {'A':4, 'B': 2, 'C':1}
base_graph = dgl.heterograph(data_dict, num_nodes_dict)
base_graph.add_edges(torch.tensor([0,1,2,3]), torch.tensor([0,0,1,1]), etype='L0')
base_graph.add_edges(torch.tensor([0,1]), torch.tensor([0,0]), etype='L1')
Now, I am trying to do a HeteroGraphConv on this graph via:
conv = dgl.nn.HeteroGraphConv({
'L0': dglnn.GATConv((2,4),4,1),
'L1': dglnn.GATConv((4,8),8,1),
})
I believe this makes the dim of typeA: 2, typeB:4, typeC:8. If I then initialize ONLY TYPE A and run the HeteroConv, I expect it to populate the typeB. If I run it again on this output, type C should be populated.
a_feats = torch.rand((4,2))
out = conv(base_graph, a_feats)
out_2 = conv(base_graph, out)
Here is where I get my first error
This returns: ‘GATConv’ object has no attribute ‘fc’
Any thoughts here? This seems like an import error. If I am able to fix it, does this method make sense? Does it seem possible?