{"id":13481260,"url":"https://github.com/muhanzhang/DGCNN","last_synced_at":"2025-03-27T11:32:14.241Z","repository":{"id":94178301,"uuid":"111512422","full_name":"muhanzhang/DGCNN","owner":"muhanzhang","description":"Code for \"M. Zhang, Z. Cui, M. Neumann, and Y. Chen, An End-to-End Deep Learning Architecture for Graph Classification, AAAI-18\".","archived":false,"fork":false,"pushed_at":"2018-05-14T19:55:41.000Z","size":50990,"stargazers_count":174,"open_issues_count":0,"forks_count":44,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-30T14:43:45.650Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Matlab","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muhanzhang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-11-21T07:08:34.000Z","updated_at":"2024-10-09T14:19:21.000Z","dependencies_parsed_at":"2023-03-22T19:02:57.207Z","dependency_job_id":null,"html_url":"https://github.com/muhanzhang/DGCNN","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhanzhang%2FDGCNN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhanzhang%2FDGCNN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhanzhang%2FDGCNN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhanzhang%2FDGCNN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhanzhang","download_url":"https://codeload.github.com/muhanzhang/DGCNN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245836319,"owners_count":20680353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:00:50.261Z","updated_at":"2025-03-27T11:32:11.315Z","avatar_url":"https://github.com/muhanzhang.png","language":"Matlab","funding_links":[],"categories":["Deep Learning","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"Deep Graph Convolutional Neural Network (DGCNN)\n===============================================\n\nUpdate 3/19/2018\n----------------\n\nThe PyTorch implementation of DGCNN is here https://github.com/muhanzhang/pytorch_DGCNN, for those who prefer using python.\n\nAbout\n-----\n\nA powerful deep neural network toolbox for graph classification, named Deep-Graph-CNN (DGCNN). DGCNN features a propagation-based graph convolution layer to extract vertex features, as well as a novel SortPooling layer which sorts vertex representations instead of summing them up. The sorting enables learning from global graph topology, and retains much more node information than summing. The SortPooling layer supports backpropagation, and sorts vertices without using any preprocessing software such as Nauty, which enables an elegant end-to-end training framework.\n\nFor more information, please refer to:\n\u003e M. Zhang,  Z. Cui,  M. Neumann,  and Y. Chen,  An End-to-End Deep Learning Architecture for\nGraph Classification,  Proc. AAAI Conference on Artificial Intelligence (AAAI-18). [\\[PDF\\]](http://www.cse.wustl.edu/~muhan/papers/AAAI_2018_DGCNN.pdf)\n\nThe DGCNN is written in Torch. MATLAB is required if you want to compare DGCNN with graph kernels.\n\nRun \"th main.lua\" to have a try of DGCNN!\n\nHow to run DGCNN\n----------------\n\nIf you do not have a deep learning environment yet, install cuda and Torch as follows (suppose you have a GPU):\n\nInstall cuda following: http://developer.nvidia.com/cuda-downloads\n\nInstall Torch following this link: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions\n\nThen, install necessary Torch libraries: cutorch, cunn, in order by:\n\n    luarocks install --local libraryName\n\nNow, you should be able to run Torch-based neural networks.\n\nThe folder \"data/\" contains the .dat graph datasets read by DGCNN. There is already a \"MUTAG.dat\" included for demo. Other graph datasets need to be generated manually:\n\n    th utils/generate_torch_graphs.lua\n\nwhich transforms the .mat graph datasets in \"data/raw_data/\" into .dat format. The \"torch.matio\" is required to be installed:\n\n    1# OSX\n    brew install homebrew/science/libmatio\n    2# Ubuntu\n    sudo apt-get install libmatio2\n    luarocks install --local matio\n\nIn case you cannot install \"torch.matio\", we also provide the converted \".dat\" for downloading directly [\\[Torch graph datasets\\]](https://drive.google.com/open?id=1vx19a8UTfj7vboafaoRtgIFv-dIqvhxl).\n\nTo run DGCNN on dataset \"DD\" (whose maximum node label is 89), with learning rate 1e-5, maximum epoch number 100, just type:\n\n    th main.lua -dataName DD -maxNodeLabel 89 -learningRate 1e-5 -maxEpoch 100\n\nAppend \"-batch -batchSize 16\" to run mini-batch optimization.\n\nTo repeatedly run DGCNN on some dataset using different shuffle orders, you can use the provided run_all.sh script:\n\n    time ./run_all.sh XXX i\n\nwhich runs DGCNN on dataset XXX with the ith GPU of your machine for 100 times, using the shuffle orders stored in \"data/shuffle\" (matio is required).\n\nThe main program of DGCNN is in \"main.lua\", please refer to it for more advanced functions to play with!\n\nHow to use your own datasets\n----------------------------\n\nDGCNN reads graph dataset in the format of dataset = {instance={i: {1: A_i, 2: X_i}}, label={i: label_i}}. You can check the format type:\n\n    dataset = torch.load(\"data/MUTAG.dat\")\n\nin the torch command line th.\n\nWe also provide a \"generate_torch_graphs.lua\" in \"utils/\" which converts standard WL kernel toolbox's graph format to DGCNN format.\n\nThere is an option \"-testNumber 200\" in \"main.lua\", which allows specifying that the last 200 examples in the dataset is the testing data. This is convenient when you put your testing data after the training data when constructing the dataset.\n\nHow to compare with graph kernels\n---------------------------------\n\nThe kernel matrices of the compared graph kernels should be put into \"data/kernels\". Run: \n\n    ComputeKernels.m\n\nto compute the kernel matrices of WL, GK and RW. Run:\n    \n    Compute_PK_kernels.m\n\nto compute the kernel matrices of PK (since the PK software uses a different graph format). We also provide the precomputed kernel matrices for downloading in case you don't want to compute them by yourselves. (Some of them take really long time!) [\\[Kernel matrices\\]](https://drive.google.com/open?id=1TneR7RJtRioFcceiIaP6njeKppVbeFFC)\n\nTo run graph kernels, run: \n\n    compare.m\n    \nin MATLAB, then the accuracy results of all graph kernels will be reported. At the same time, a fixed data shuffling order will be generated and saved in \"data/shuffle\" for each dataset (thus their train/val/test splits are fixed). These shuffle orders are already included in this toolbox. Change the *rand_start* inside compare.m to generate your own shuffle orders.\n\nRequired libraries\n------------------\n\nTorch libraries needed: paths, torch, nn, cunn, cutorch, optim. Install them using:\n\n    luarocks install --local libraryName\n\nThe main folder contains other required modules: SortPooling, GraphConv, GraphReLU, GraphTanh, GraphSelectTable, GraphConcatTable.\n\nTo compare DGCNN with graph kernels, libsvm is required to be installed in \"software/libsvm-3.22\". A zip of libsvm is included in \"software/\" already, you can unzip it and compile the mex files according to its documentations.\n\nTo compare with graph kernels, the toolbox \"graphkernels\" and \"propagation_kernels-master\" have been included in software/ already, which come from the following papers:\n\n\u003e N. Shervashidze, P. Schweitzer, E. J. van Leeuwen, K. Mehlhorn, and K. M. Borgwardt.\nWeisfeiler-lehman graph kernels. Journal of Machine Learning Research, 12:2539-2561, 2011.\n\n\u003e Marion Neumann, Roman Garnett, Christian Bauckhage, Kristian Kersting.\nPropagation kernels: efficient graph kernels from propagated information. (2015). Machine Learning. 102 (2), pp. 209-245. \n\nReference\n---------\n\nIf you find the code useful, please cite our paper:\n    \n    @inproceedings{zhang2018end,\n        title={An End-to-End Deep Learning Architecture for Graph Classification},\n        author={Zhang, Muhan and Cui, Zhicheng and Neumann, Marion and Chen, Yixin},\n        booktitle={AAAI},\n        pages={4438--4445},\n        year={2018}\n    } \n\nMuhan Zhang, muhan@wustl.edu\n12/2/2017\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhanzhang%2FDGCNN","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhanzhang%2FDGCNN","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhanzhang%2FDGCNN/lists"}