Question on edge features of different edge types
I want to create a heterograph using dgl.heterograph and I am not sure how I can assign the edge features correctly.
For example, a heterograph includes both data_1 and data_2
data_1 = {
(‘node’, ‘node_links_node’, ‘node’): (node_l, node_r),
(‘node’, ‘node_links_node’, ‘node’): (node_r, node_l),
}
Feature of node_links_node has dimension = 3
data_2 = {
(‘node’, ‘node_has_color’, ‘color’): (node, color),
}
Feature of ‘node_has_color’ has dimension = 2
Here are my questions:
-
Should I use self.g.edata[‘edge_feature’] to assign edge features, since the dimensions do not match in data_1 and data_2?
-
And how can I sanity check the edge features are correctly assigned. For example
- Node1 “node_links_node” Node2 => edge1 (feature dimension = 3)
- Node1 “node_links_node” Node3 => edge2 (feature dimension = 3)
- Node1 “node_has_color” color1 => edge3 (feature dimension = 2)
I want to retrieve the feature of edge3 from the whole graph g by key “node1 and color1”, how should I do that?