Static graph for whole dataset #7217
Answered
by
rusty1s
ralfriegel5
asked this question in
Q&A
-
I want to solve a regression task with n samples. The inputs are graph-structured. The graph does not change over the samples, i.e. it is a static graph for the whole dataset. In other words, only the node features change over the samples. As each sample is supposed to be one Many thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
rusty1s
Apr 21, 2023
Replies: 1 comment 1 reply
-
You can also define your graph outside of class Dataset(...):
def __init__(self, ...):
self.edge_index = ...
self.data, self.slices = torch.load(self.processed_paths[0])
def __getitem__(self, idx):
data = super().__getitem__(self, idx)
data.edge_index = self.edge_index
return data |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ralfriegel5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also define your graph outside of
data
objects, e.g.