Skip to content
Discussion options

You must be logged in to vote

Interesting problem. You could try to implement a dataset wrapper class, that returns 3 graphs and the labels of the fourth:

class GroupDataset(torch.utils.data.Dataset):
    def __init__(self, dataset, window=3):
        super().__init__()
        self.dataset = dataset
        self.window = window
        
    def __len__(self):
        return len(self.dataset) - self.window
        
    def __getitem__(self, idx):
        data_list = [self.dataset[idx + offset] for offset in range(self.window)
        y = self.dataset[idx + self.window].y
        return data_list, y

Replies: 1 comment 15 replies

Comment options

You must be logged in to vote
15 replies
@mtzortzi
Comment options

@rusty1s
Comment options

@mtzortzi
Comment options

@rusty1s
Comment options

@mtzortzi
Comment options

Answer selected by mtzortzi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants