Pair of Hetero Graphs #4768
-
Hi, The batching page provides nice details on how to create a new class based on the Data class to store 2 graphs and also overwrite the inc function to ensure the batching is working properly.
For the second graph, we have
and the label is: How can I create a class based on HeteroData and store this information? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think you should avoid integrating class MyDataset(...):
...
def __getitem__(self, idx):
return self.dataset1[idx], self.dataset2[idx] You can then use this dataset as part of
WDYT? |
Beta Was this translation helpful? Give feedback.
-
I'm glad this got answered, but I'm stubborn and want to do it the hard way. Mostly so that I can understand the collating that is going on with the I'm stuck at the same issues with modifying
For some reason As a random aside: Ali if you see this it's been a very long time and I'm glad you figured out how to parse ASTs for hetero GNNs. Also please give Dr. Jannesari my apologies for disappearing after the Euromicro paper. |
Beta Was this translation helpful? Give feedback.
I think you should avoid integrating
PairData
withHeteroData
objects, this is likely to become a nightmare to maintain. Instead, you should have aPairDataset
that returns a tuple ofHeteroData
objects:You can then use this dataset as part of
torch_geometric.loader.DataLoader
:WDYT?