{"id":16388228,"url":"https://github.com/nyxflower/gripnet","last_synced_at":"2025-03-23T04:31:31.793Z","repository":{"id":49367988,"uuid":"246186130","full_name":"NYXFLOWER/GripNet","owner":"NYXFLOWER","description":"GripNet: Graph Information Propagation on Supergraph for Heterogeneous Graphs (PatternRecognit, 2023)","archived":false,"fork":false,"pushed_at":"2023-03-08T21:26:58.000Z","size":92307,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T17:44:27.304Z","etag":null,"topics":["data-integration","graph-neural-networks","heterogeneous-graph","interconnected-graph","link-prediction","node-classification","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NYXFLOWER.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-10T02:07:14.000Z","updated_at":"2024-11-06T14:13:27.000Z","dependencies_parsed_at":"2024-10-28T15:24:47.987Z","dependency_job_id":"c6ca4e0f-84ac-4fa0-8e61-17d035d4f38e","html_url":"https://github.com/NYXFLOWER/GripNet","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/NYXFLOWER%2FGripNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NYXFLOWER%2FGripNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NYXFLOWER%2FGripNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NYXFLOWER%2FGripNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NYXFLOWER","download_url":"https://codeload.github.com/NYXFLOWER/GripNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245056889,"owners_count":20553855,"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":["data-integration","graph-neural-networks","heterogeneous-graph","interconnected-graph","link-prediction","node-classification","pytorch"],"created_at":"2024-10-11T04:28:39.442Z","updated_at":"2025-03-23T04:31:31.334Z","avatar_url":"https://github.com/NYXFLOWER.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graph Information Propagation Network (GripNet) Model\n\nThis repository contains the official implementation of GripNet, as well as eight datasets and experiments on link prediction and node classification. The description of model and the results can be found in our paper:\n\n[GripNet: Graph Information Propagation on Supergraph for Heterogeneous Graphs](https://doi.org/10.1016/j.patcog.2022.108973), Hao Xu, Shengqi Sang, Peizhen Bai, Ruike Li, Laurence Yang, Haiping Lu (Pattern Recognition, 2023)\n\n🍺 **Update August 2022**: *Check out [this work](https://doi.org/10.1145/3511808.3557676) by Haiping Lu et al. (CIKM, 2022) from the PyKale team. In the [`pykale`](https://github.com/pykale/pykale) library, the structure and interface of GripNet implementation are improved, which makes it more convenient to construct GripNet models applied to knowledge graphs with high heterogeneity.*\n\n## GripNet and Baselines\n\nGripNet is an effective and efficient framework to learn node representations on **heterogeneous graphs** (or Knowledge Graphs) for multi-relational **link prediction**, and **node classification**, when there is only a type of node/edge related to the task. It is also a natural framework for graph-like **data integration** (i.e. integrating multiple datasets).\n\nWe provide the implementations of GripNet in the root directory, and those of baselines:\n\n- TransE, RotatE, ComplEx, DistMult and RGCN on link prediction (LP) in `baselines/LP_baselines/`, and\n- GCN, GAT, and RGCN on node classification (NC) in `baselines/NC_baselines/`.\n\nEach model directory contains a bash script, which gives examples to run models. You can explore different model structures and hyperparameter settings by changing input parameters or code directly. \n\nIt takes three steps to run these scripts.\n\n### Step 1: Installation\n\nAll models in this repository are built on top of the [`PyTorch`](https://pytorch.org/get-started/locally/) and [`PyG`](https://github.com/pyg-team/pytorch_geometric). Before installing the `gripnet` package, `torch\u003e=1.4.0` and `torch_geometric\u003c2.0` are required to be installed matching your hardware.\n\nThen, install the `gripnet` from source:\n```bash\ngit clone https://github.com/NYXFLOWER/GripNet.git\ncd GripNet\npip install .\n```\n\n### Step 2: Dataset preparation\n\nWe constructed eight datasets for the experiments: three link prediction datasets (pose-0/1/2) and five node classification datasets (aminer and freebase-a/b/c/d).\n\nThe datasets need to be downloaded to the corresponding directories with the provided links and unzipped:\n\n- `.`: https://www.dropbox.com/s/hnt3v5890qozbtx/datasets.zip\n- `./baselines/`: https://www.dropbox.com/s/wieca61m7jw2zqv/datasets_baselines.zip\n\nOr, prepare the datasets using the following commands:\n\n```bash\nwget https://www.dropbox.com/s/hnt3v5890qozbtx/datasets.zip\nunzip datasets.zip \u0026\u0026 rm datasets.zip\n\ncd baselines/\nwget https://www.dropbox.com/s/g81hgxnewi7br8d/datasets_baselines.zip\nunzip datasets_baselines.zip \u0026\u0026 rm datasets_baselines.zip\n```\n\nAdditionally, the raw data and code for constructing these datasets are available to download using: \n```bash\nwget https://www.dropbox.com/s/41e43exro113pc9/data.zip \n```\nWe collect the data from the [BioSNAP](https://snap.stanford.edu/biodata/index.html), [AminerAcademicNetwork](https://dl.acm.org/doi/10.1145/1401890.1402008), and [Freebase](https://ieeexplore.ieee.org/document/9300240) databases.\n\n### Step 3: Running scripts\n\nWe provide descriptions of arguments in these bash scripts.\nTo run a given experiment, execute our bash scripts as follows:\n\n#### Run GripNet demo:\n\n```bash\nbash run.sh\n```\n\n#### Run baseline demo:\n\n```bash\ncd baselines\nbash run_lp.sh\t# link prediction\nbash run_nc.sh\t# node classification\n```\n\n🧋 **Note when not using GPUs**: *We use the [`pytorch_memlab`](https://github.com/Stonesjtu/pytorch_memlab) package by default to evaluate the GPU memory usage during training. If you are trining GripNet models on CPUs only, please find and comment all lines of `@profile` in the code. For example, comment Line 112 in `GripNet-pose.py`*:\n\nhttps://github.com/NYXFLOWER/GripNet/blob/43022286290ae10f1d615520cc8ef37320e41953/GripNet-pose.py#L109-L113\n\n## Citation\n\nPlease consider citing our paper below if you find GripNet or this code useful to your research.\n\n```latex\n@article{xu2022gripnet,\n    title={GripNet: Graph Information Propagation on Supergraph for Heterogeneous Graphs},\n    author={Xu, Hao and Sang, Shengqi and Bai, Peizhen and Li, Ruike and Yang, Laurence and Lu, Haiping},\n    journal={Pattern Recognition},\n    pages={108973},\n    year={2022},\n    publisher={Elsevier}\n}\n```\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/sangsq\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/16742808?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003esangsq\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/NYXFLOWER/GripNet/commits?author=sangsq\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-sangsq\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://www.peizhenbai.me\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/67964033?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003epeizhenbai\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/NYXFLOWER/GripNet/commits?author=pz-white\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/NYXFLOWER/GripNet/commits?author=pz-white\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"#data-pz-white\" title=\"Data\"\u003e🔣\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Lyric-19\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/55618685?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLyric-19\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/NYXFLOWER/GripNet/issues?q=author%3ALyric-19\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/O3Ol\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/46882376?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eO3Ol\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/NYXFLOWER/GripNet/issues?q=author%3AO3Ol\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnyxflower%2Fgripnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnyxflower%2Fgripnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnyxflower%2Fgripnet/lists"}