Assign edge features of different edge types

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?

I did not get it. Why did you have 2-tuples as the values of the dictionaries?

because I have two homogeneous graphs here data_1 and data_2, and the heterograph is upon these two.

So data_1 and data_2 are dictionaries for graph construction?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.