homophily_ratio on batches #3028
Unanswered
RasmusOrsoe
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Try this out |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
torch_geometric.utils.homophily_ratio seems to output a single value for a batch of graphs. I'd like to extract this value on a per-graph level, such that instead of a single number, the output would be [batch_size,1].
I realize I could simply calculate this quantity when the graphs are constructed, as a preprocessing step, but for my specific problem the edges change dynamically in the model, and I'd like to be able to calculate this on the fly during training.
I've tried a naive approach in the forward function
but I struggle with decomposing the batch-level edge_index into a graph-level edge_index!
Do you have any ideas?
Beta Was this translation helpful? Give feedback.
All reactions