Bipartite graph sampling / K-hop sampling #2898
-
Hello @rusty1s ! Thank you for your project! I have some difficulties with implementing two types of sampling. My data consists of 2 graph structures: ordinary graph G and bipartite graph B. I need to sample from both and apply some aggregation (both pooling and message passing, it depends on approach) to the sampled subgraph. Can you help me to find the right way to perform these actions?
Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
We are actively working on sampling support for bipartite graphs/heterogeneous graphs, so please stay tuned :)
|
Beta Was this translation helpful? Give feedback.
We are actively working on sampling support for bipartite graphs/heterogeneous graphs, so please stay tuned :)
For sampling the complete neighborhood, you can either use
NeighborSampler
withsizes=[-1] * k
or usetorch_geometric.utils.k_hop_subgraph
.We do not have a dedicated implementation for that yet. If possible, I suggest to create one big graph (containing both
G
andB
), and sample from their, e.g, by stackingG
, andB
into a single adjacency matrix, as we do here.