Integrating source_to_target and target_to_source flow in bipartite graph.
See original GitHub issue❓ Questions & Help
Hello! Thank you for building such a well-documented and well-maintained library. I’m new to Graph Neural Networks, and I am learning to build a bipartite graph network, for the following nodes:
I have gone through issues page to understand how to integrate source_to_target and target_to_source flows for some nodes. So currently, I made 2 BipartiteData objects, where edge_index is defined differently:
x_s = ... # size [7, 300]
x_t = ... # size [7, 11]
edge_index_1 = torch.tensor([[0, 1, 4, 4, 4, 4, 6], [3, 1, 0, 2, 5, 6, 4]], dtype=torch.long) #for source_to_target
edge_index_2 = torch.tensor([0, 1, 2, 3, 4, 5, 6], [0, 1, 2, 3, 4, 5, 6]], dtype=torch.long) #for target_to_source
graph_data_1 = BipartiteData(x_s=x_s, edge_index=edge_index_1, x_t=x_t)
graph_data_2 = BipartiteData(x_s=x_s, edge_index=edge_index_2, x_t=x_t)
Then, graph_data_1
and graph_data_2
are passed through separate GCN layers; where one overrides MessagePassing
with flow = 'source_to_target'
and the other overrides MessagePassing
with flow = 'target_to_source'
.
Is this a good approach to this problem? Also, how do I further join the outputs of the 2 GCN layers and get an overall node representation?
Your clarification will be appreciated 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (9 by maintainers)
Top GitHub Comments
Yeah, the batch object is not present because PyG cannot identify how to create it. You can pass the
follow_batch
argument to theDataLoader
to signal PyG which batches it should track:You can also define it as
There is no limitation in how many attributes you can store in
data
.