Skip to content
Discussion options

You must be logged in to vote

Thanks for bringing this up. Currently there's nothing similar for heterogenous graphs. But it will be useful to add such support to LocalDegreeProfile. And the implementation would have to handle neighborhoods through different edge types.

You could use something similar to the below code to achieve this for now

N # number of author nodes
row_author, col_paper = data['author', 'writes', 'paper'].edge_index
row_paper, col_author = data['paper', 'written_by', 'author'].edge_index

 # degree of author for edge type ('author', 'writes', 'paper')
deg_author =  degree(row_author, N, dtype=torch.float)

# degree of paper nodes for edge type ('paper', 'written_by', 'author'), connected to author…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@rusty1s
Comment options

@fredjo89
Comment options

@rusty1s
Comment options

Answer selected by fredjo89
Comment options

You must be logged in to vote
1 reply
@rusty1s
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants