'collections.namedtuple' imported but unused:
9 from collections import namedtuple'tqdm' imported but unused:
10 import tqdmLine too long (102 > 79 characters):
19 This dataset is directly adopted from Open Graph Benchmark, and originally curated by MoleculeNet.Line too long (93 > 79 characters):
32 Each molecule is annotated with the scaffold ID that the molecule is assigned to.Line too long (82 > 79 characters):
39 title={Open Graph Benchmark: Datasets for Machine Learning on Graphs},Line too long (112 > 79 characters):
40 author={W. {Hu}, M. {Fey}, M. {Zitnik}, Y. {Dong}, H. {Ren}, B. {Liu}, M. {Catasta}, J. {Leskovec}},Line too long (129 > 79 characters):
47 author={Z. {Wu}, B. {Ramsundar}, E. V {Feinberg}, J. {Gomes}, C. {Geniesse}, A. S {Pappu}, K. {Leswing}, V. {Pande}},Line too long (114 > 79 characters):
67 def __init__(self, version=None, root_dir='data', download=False, split_scheme='official', random_split=False,Line too long (118 > 79 characters):
71 raise ValueError('Versioning for OGB-MolHIV is handled through the OGB package. Please set version=none.')Line too long (85 > 79 characters):
73 self.ogb_dataset = PygGraphPropPredDataset(name='ogbg-molhiv', root=root_dir)Line too long (138 > 79 characters):
80 self._y_type = 'float' # although the task is binary classification, the prediction target contains nan value, thus we need floatLine too long (115 > 79 characters):
93 val_split_idx = random_index[len(split_idx['train']):len(split_idx['train']) + len(split_idx['valid'])]Line too long (93 > 79 characters):
94 test_split_idx = random_index[len(split_idx['train']) + len(split_idx['valid']):]Line too long (95 > 79 characters):
108 metadata_file_path = os.path.join(self.ogb_dataset.root, 'raw', 'OGB-MolHIV_group.npy')Line too long (112 > 79 characters):
111 'https://www.dropbox.com/s/i5z388zxbut0quo/OGB-MolHIV_group.zip?dl=1', self.ogb_dataset.raw_dir)Line too long (103 > 79 characters):
114 self._metadata_array_wo_y = torch.from_numpy(np.load(metadata_file_path)).reshape(-1, 1).long()Line too long (97 > 79 characters):
115 self._metadata_array = torch.cat((self._metadata_array_wo_y, self.ogb_dataset.data.y), 1)Line too long (111 > 79 characters):
133 subgraph = GSN(dataset_name='ogbg-molhiv', dataset_group='ogb', induced=True, id_type=self.id_type,Line too long (116 > 79 characters):
135 self.graphs_ptg, self.encoder_ids, self.d_id, self.d_degree = subgraph.preprocess(self.ogb_dataset.root)Line too long (86 > 79 characters):
146 self.num_edge_features = self.graphs_ptg[0].edge_features.shape[1]Line too long (91 > 79 characters):
168 - prediction_fn (function): A function that turns y_pred into predicted labels.Line too long (106 > 79 characters):
169 Only None is supported because OGB Evaluators accept binary logitsLine too long (120 > 79 characters):
174 assert prediction_fn is None, "OGBHIVDataset.eval() does not support prediction_fn. Only binary logits accepted"Line too long (89 > 79 characters):
185 deg_inv = torch.where(deg > 0, 1. / torch.sqrt(deg), torch.zeros(deg.size()))Line too long (109 > 79 characters):
201 adj = _sym_normalize_adj(to_dense_adj(graph.edge_index, max_num_nodes=graph.x.size(0)).squeeze())Line too long (103 > 79 characters):
216 adj_feat[1:1 + node_feat_space.sum(), node, node] = convert(node_feat, node_feat_space)Line too long (85 > 79 characters):
218 target, source = graph.edge_index[0][edge], graph.edge_index[1][edge]Line too long (106 > 79 characters):
220 adj_feat[1 + node_feat_space.sum():, target, source] = convert(edge_feat, edge_feat_space)