divelab / DIG

A library for graph deep learning research
https://diveintographs.readthedocs.io/
GNU General Public License v3.0
1.84k stars 280 forks source link

Some problems on training new SubgraphX gnns #91

Closed ZhaoningYu1996 closed 2 years ago

ZhaoningYu1996 commented 2 years ago

Hi,

I am planning to train a new SubgraphX on the Mutagenicity dataset. I find a line in MUTAGDataset class: adj_all = np.zeros((len(nodes_all), len(nodes_all))) This line will create a really large array when the size of the dataset is large. (For Mutagenicity, the shape of the array is (131488, 131488)) Could you tell me how can I do to avoid the out-of-memory issue?

Thank you, Zhaoning

Oceanusity commented 2 years ago

Hello. This code is especially for the MUTAG datasets with 189 molecules. I think you can write codes for the Mutagenicity datasets to read the graph with sparse matrix, and the key is to save torch_geometric.data.Data to the data_list for each graph.