Skip to content
Discussion options

You must be logged in to vote

How should type_vec and type_ptr be constructed?

This refers to the same data just in a different format. type_vec refers to the classic [0, 0, 0, 1, 1, 1, 2, 2, 2, ...] index representation which assigns each node to a specific node type. type_ptr refers to its compressed representation, i.e., it only stores its boundaries, e.g.: [0, 4, 7] for two node types where node type 1 has 4 nodes and node type 2 has 3 nodes.

If you are using dictionaries to process heterogeneous graphs, you can just do

norms = torch.nn.ModuleDict({node_type: BatchNorm(...) for node_type in node_types})

x_dict = {key: norms[key](x) for x, key in x_dict.items()}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RENEK-bool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants