Heterogeneous Graphs
Heterogeneous Graphs
z
Graph
Hamza Naeem
21-CS-09
z
Definition
Attribute Diversity: Nodes and edges within heterogeneous graphs can exhibit a
wide array of attributes. These attributes furnish additional context about the entities
and relationships they signify, including textual descriptions, numerical values,
temporal information, and other pertinent data types.
data_dict = {
('user', 'watches', 'movie'): (torch.tensor([0, 0, 1, 2]),
torch.tensor([0, 1, 0, 1])),
('director', 'directs', 'movie'): (torch.tensor([0, 1]),
torch.tensor([1, 0]))
}
hetero_graph = dgl.heterograph(data_dict)
hetero_graph