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 dgl | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import dgl.data | |
# Generate a synthetic dataset with 10000 graphs, ranging from 10 to 500 nodes. | |
dataset = dgl.data.GINDataset('PROTEINS', self_loop=True) | |
print('Node feature dimensionality:', dataset.dim_nfeats) |
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 dgl | |
import torch | |
import multiprocessing as mp | |
g_graph = dgl.rand_graph(20000,300000).to('cuda') | |
g_graph.ndata['x'] = torch.rand(g_graph.num_nodes(),3).to('cuda') | |
sampler = dgl.dataloading.MultiLayerNeighborSampler([15, 10]) | |
dataloader = dgl.dataloading.NodeDataLoader( | |
g_graph, torch.arange(0, g_graph.num_nodes(), dtype=torch.int64).to('cuda'), sampler, device='cuda', |