Created
May 17, 2021 20:57
-
-
Save sidneyarcidiacono/1272af21d899abf1a55f898ab2b8c6a7 to your computer and use it in GitHub Desktop.
Initialize loaders for batching with pytorch-geometric
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import DataLoader for batching | |
from torch_geometric.data import DataLoader | |
# our DataLoader creates diagonal adjacency matrices, and concatenates features | |
# and target matrices in the node dimension. This allows differing numbers of nodes and edges | |
# over examples in one batch. (from pytorch geometric docs) | |
train_loader = DataLoader(train_dataset, batch_size=64, shuffle=True) | |
test_loader = DataLoader(test_dataset, batch_size=64, shuffle=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment