{"id":13958334,"url":"https://github.com/huangtinglin/MixGCF","last_synced_at":"2025-07-20T23:31:27.961Z","repository":{"id":170122666,"uuid":"373758732","full_name":"huangtinglin/MixGCF","owner":"huangtinglin","description":"MixGCF: An Improved Training Method for Graph Neural Network-based Recommender Systems, KDD2021","archived":false,"fork":false,"pushed_at":"2022-05-31T05:10:47.000Z","size":17083,"stargazers_count":90,"open_issues_count":8,"forks_count":25,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-24T05:53:55.026Z","etag":null,"topics":["graph-neural-network","information-retrieval","negative-sampling","network-embedding","pytorch","recommender-system"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huangtinglin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-06-04T07:32:01.000Z","updated_at":"2024-05-05T06:35:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"90468001-1ed2-4f8c-8e75-73d055f5f2e9","html_url":"https://github.com/huangtinglin/MixGCF","commit_stats":null,"previous_names":["huangtinglin/mixgcf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangtinglin%2FMixGCF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangtinglin%2FMixGCF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangtinglin%2FMixGCF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangtinglin%2FMixGCF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huangtinglin","download_url":"https://codeload.github.com/huangtinglin/MixGCF/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":214509418,"owners_count":15743729,"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":["graph-neural-network","information-retrieval","negative-sampling","network-embedding","pytorch","recommender-system"],"created_at":"2024-08-08T13:01:29.796Z","updated_at":"2024-08-08T13:03:30.726Z","avatar_url":"https://github.com/huangtinglin.png","language":"Python","funding_links":[],"categories":["其他_推荐系统"],"sub_categories":["网络服务_其他"],"readme":"# MixGCF: An Improved Training Method for Graph Neural Network-based Recommender Systems\n\nThis is our PyTorch implementation for the paper:\n\n\u003e Tinglin Huang, Yuxiao Dong, Ming Ding, Zhen Yang, Wenzheng Feng, Xinyu Wang, Jie Tang (2021). MixGCF: An Improved Training Method for Graph Neural Network-based Recommender Systems.  [Paper link](http://keg.cs.tsinghua.edu.cn/jietang/publications/KDD21-Huang-et-al-MixGCF.pdf). In KDD'2021, Virtual Event, Singapore, August 14-18, 2021.\n\nAuthor: Mr. Tinglin Huang (tinglin.huang at zju.edu.cn)\n\n## Citation \n\nIf you want to use our codes in your research, please cite:\n​    \n```\n@inproceedings{MixGCF2021,\n  author    = {Tinglin Huang and\n               Yuxiao Dong and\n               Ming Ding and\n               Zhen Yang and\n               Wenzheng Feng and\n               Xinyu Wang and\n               Jie Tang},\n  title     = {MixGCF: An Improved Training Method for Graph Neural Network-based Recommender Systems},\n  booktitle = {{KDD}},\n  year      = {2021}\n}\n```\n\n## Environment Requirement\n\nThe code has been tested running under Python 3.7.6. The required packages are as follows:\n\n- pytorch == 1.7.0\n- numpy == 1.20.2\n- scipy == 1.6.3\n- sklearn == 0.24.1\n- prettytable == 2.1.0\n\n## Training\n\nThe instruction of commands has been clearly stated in the codes (see the parser function in utils/parser.py). Important argument:\n\n- `K`\n  - It specifies the number of negative instances in K-pair loss. Note that when K=1 (by default), the K-pair loss will degenerate into the BPR pairwise loss.\n- `n_negs`\n  - It specifies the size of negative candidate set when using MixGCF.\n- `ns`\n  - It indicates the type of negative sample method. Here we provide two options: rns and mixgcf.\n\n#### LightGCN\n\n##### Random sample(rns)\n\n```\npython main.py --dataset ali --gnn lightgcn --dim 64 --lr 0.001 --batch_size 2048 --gpu_id 0 --context_hops 3 --pool mean --ns rns --K 1 --n_negs 1\n\npython main.py --dataset yelp2018 --gnn lightgcn --dim 64 --lr 0.001 --batch_size 2048 --gpu_id 0 --context_hops 3 --pool mean --ns rns --K 1 --n_negs 1\n\npython main.py --dataset amazon --gnn lightgcn --dim 64 --lr 0.001 --batch_size 2048 --gpu_id 0 --context_hops 3 --pool mean --ns rns --K 1 --n_negs 1\n```\n\n#####  MixGCF\n\n```\npython main.py --dataset ali --dim 64 --lr 0.001 --batch_size 2048 --gpu_id 0 --context_hops 3 --pool mean --ns mixgcf --K 1 --n_negs 32\n\npython main.py --dataset yelp2018 --dim 64 --lr 0.001 --batch_size 2048 --gpu_id 0 --context_hops 3 --pool mean --ns mixgcf --K 1 --n_negs 64\n\npython main.py --dataset amazon --dim 64 --lr 0.001 --batch_size 2048 --gpu_id 0 --context_hops 3 --pool mean --ns mixgcf --K 1 --n_negs 16\n```\n\n#### NGCF\n\n##### Random sample(rns)\n\n```\npython main.py --dataset ali --gnn ngcf --dim 64 --lr 0.0001 --batch_size 1024 --gpu_id 0 --context_hops 3 --pool concat --ns rns --K 1 --n_negs 1\n\npython main.py --dataset yelp2018 --gnn ngcf --dim 64 --lr 0.0001 --batch_size 1024 --gpu_id 0 --context_hops 3 --pool concat --ns rns --K 1 --n_negs 1\n\npython main.py --dataset amazon --gnn ngcf --dim 64 --lr 0.0001 --batch_size 1024 --gpu_id 0 --context_hops 3 --pool concat --ns rns --K 1 --n_negs 1\n```\n\n##### MixGCF\n\n```\npython main.py --dataset ali --gnn ngcf --dim 64 --lr 0.0001 --batch_size 1024 --gpu_id 0 --context_hops 3 --pool concat --ns mixgcf --K 1 --n_negs 64\n\npython main.py --dataset yelp2018 --gnn ngcf --dim 64 --lr 0.0001 --batch_size 1024 --gpu_id 0 --context_hops 3 --pool concat --ns mixgcf --K 1 --n_negs 64\n\npython main.py --dataset amazon --gnn ngcf --dim 64 --lr 0.0001 --batch_size 1024 --gpu_id 0 --context_hops 3 --pool concat --ns mixgcf --K 1 --n_negs 64\n```\n\nThe [training log](https://github.com/huangtinglin/MixGCF/tree/main/training_log) is also provided. The results fluctuate slightly under different running environment.\n\n## Dataset\n\nWe use three processed datasets: Alibaba, Yelp2018, and Amazon.\n\n|               | Alibaba | Yelp2018  | Amazon    |\n| ------------- | ------- | --------- | --------- |\n| #Users        | 106,042 | 31,668    | 192,403   |\n| #Items        | 53,591  | 38,048    | 63,001    |\n| #Interactions | 907,407 | 1,561,406 | 1,689,188 |\n| Density       | 0.00016 | 0.00130   | 0.00014   |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuangtinglin%2FMixGCF","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuangtinglin%2FMixGCF","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuangtinglin%2FMixGCF/lists"}