Subgraph dataset implementation #2728
dongkwan-kim
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
This depends on where you actually want to do the subgraph processing. I think you have two options:
@property
def len(self):
return x # The number of subgraphs
def get(self, idx):
# Perform subgraph computation here and return the sub data. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hi, I am implementing codes for subgraph datasets in Subgraph Neural Networks. I need some advices before creating a PR.
In
InMemoryDataset
, we first createdata_list
and callcollate
to getData
andslices
. However, in subgraph prediction tasks, there are one supergraph (edgesedge_index
and node featuresx
) and a set of subgraphs (node indicesx_index
). Edges in subgraphs can be induced from the supergraph usingutils.subgraph
.Since edges in the global graph are not given to each subgraph instance, we cannot collate them into a single
Data
object. In my latest version, I made two separate member variables inInMemoryDataset
:self.global_data
for the supergraph,self.data
for a set of subgraphs (w/self.collate
).There does not seem to be an example of subgraph datasets in PyG (I might miss them), so I would like to discuss what the best form will be. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions