{"id":13793898,"url":"https://github.com/Netease-Games-AI-Lab-Guangzhou/PerfectDou","last_synced_at":"2025-05-12T20:31:23.767Z","repository":{"id":68596973,"uuid":"544096803","full_name":"Netease-Games-AI-Lab-Guangzhou/PerfectDou","owner":"Netease-Games-AI-Lab-Guangzhou","description":"[NeurIPS 2022] PerfectDou: Dominating DouDizhu with Perfect Information Distillation ","archived":false,"fork":false,"pushed_at":"2024-05-14T12:52:58.000Z","size":29177,"stargazers_count":161,"open_issues_count":3,"forks_count":33,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-11-18T08:55:44.261Z","etag":null,"topics":["deep-learning","gameai","imperfect-information-games","pocker","reinforcement-learning"],"latest_commit_sha":null,"homepage":"https://outer-perfectdou-demo-gzailab.nie.netease.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Netease-Games-AI-Lab-Guangzhou.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":"2022-10-01T16:30:35.000Z","updated_at":"2024-11-05T13:55:41.000Z","dependencies_parsed_at":"2024-11-18T08:51:21.471Z","dependency_job_id":null,"html_url":"https://github.com/Netease-Games-AI-Lab-Guangzhou/PerfectDou","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/Netease-Games-AI-Lab-Guangzhou%2FPerfectDou","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netease-Games-AI-Lab-Guangzhou%2FPerfectDou/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netease-Games-AI-Lab-Guangzhou%2FPerfectDou/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netease-Games-AI-Lab-Guangzhou%2FPerfectDou/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Netease-Games-AI-Lab-Guangzhou","download_url":"https://codeload.github.com/Netease-Games-AI-Lab-Guangzhou/PerfectDou/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253816734,"owners_count":21968875,"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":["deep-learning","gameai","imperfect-information-games","pocker","reinforcement-learning"],"created_at":"2024-08-03T23:00:32.945Z","updated_at":"2025-05-12T20:31:18.728Z","avatar_url":"https://github.com/Netease-Games-AI-Lab-Guangzhou.png","language":"Python","funding_links":[],"categories":["Open-Source Projects"],"sub_categories":["Dou Dizhu Projects"],"readme":"# [NeurIPS 2022] PerfectDou: Dominating DouDizhu with Perfect Information Distillation\nThe official repo for the NeurIPS 2022 paper \u003cPerfectDou: Dominating DouDizhu with Perfect Information Distillation\u003e.\n\n**Note: We only realease our pretrained model and the evaluation code. The training code is currently unavailable since a distributed system was used. The codes for calculating left hands and for feature engineering are provided as shared library (i.e., *.so file), the details of these two modules could be found in the paper. We will inform you at the first time once we decide to open source these codes.**\n\n## An online demo to play with! Have fun!\n* Online Demo: [https://outer-perfectdou-demo-gzailab.nie.netease.com](https://outer-perfectdou-demo-gzailab.nie.netease.com)\n\n## About PerfectDou\n\nPerfectDou is current the state-of-the-art DouDizhu AI system for the game of [DouDizhu](https://en.wikipedia.org/wiki/Dou_dizhu) ([斗地主](https://baike.baidu.com/item/%E6%96%97%E5%9C%B0%E4%B8%BB/177997)) developed by **Netease Games AI Lab**, with **Shanghai Jiao Tong University** and **Carnegie Mellon University**. \n\nThe proposed technique named perfect information distillation (a perfect-training-imperfect-execution framework) allows the agents to utilize the global information to guide the training of the policies as if it is a perfect information game and the trained policies can be used to play the imperfect information game during the actual gameplay.  \n\n\u003cimg width=\"500\" src=\"images/result.jpg\" alt=\"result\" /\u003e  \n\nFor more details, please check our [paper](https://arxiv.org/abs/2203.16406), where we show how and why PerfectDou beats all existing AI programs, and achieves state-of-the-art performance.\n\n*   Paper: [https://arxiv.org/abs/2203.16406](https://arxiv.org/abs/2203.16406) \n\n\n## Cite this Work\n\n```bibtex\n@inproceedings{yang2022perfectdou,\n  title={PerfectDou: Dominating DouDizhu with Perfect Information Distillation},\n  author={Yang, Guan and Liu, Minghuan and Hong, Weijun and Zhang, Weinan and Fang, Fei and Zeng, Guangjun and Lin, Yue},\n  booktitle={NeurIPS},\n  year={2022}\n}\n```\n\n## Evaluation Pipeline\nThe pre-trained model is provided in `perfectdou/model/`. For the convenience of comparison, the game environment and evaluation methods are the same as those in [DouZero](https://github.com/kwai/DouZero/tree/main/douzero/evaluation).\n  \nSome pre-trained models and heuristics as baselines have also been provided:\n*   [random](douzero/evaluation/random_agent.py): agents that play randomly (uniformly)\n*   [rlcard](douzero/evaluation/rlcard_agent.py): the rule-based agent in [RLCard](https://github.com/datamllab/rlcard)\n*   [DouZero](https://github.com/kwai/DouZero): the ADP (Average Difference Points) version\n*  PerfectDou: the 2.5e9 frames version in the paper\n\n### Step 0: Ready for Prerequisite\n\nFirst, clone the repo \n```\ngit clone https://github.com/Netease-Games-AI-Lab-Guangzhou/PerfectDou.git\n```\nMake sure you have python 3.7 installed and then install dependencies:\n```\ncd PerfectDou\npip3 install -r requirements.txt\n```\n\n### Step 1: Generate evaluation data\n```\npython3 generate_eval_data.py\n```\nSome important hyperparameters are as follows:\n*   `--output`: where the pickled data will be saved\n*   `--num_games`: how many random games will be generated, default 10000\n\n### Step 2: Self-Play\n```\npython3 evaluate.py\n```\nSome important hyperparameters are as follows:\n*   `--landlord`: which agent will play as Landlord, which can be random, rlcard, douzero, perfectdou, or the path of the pre-trained model\n*   `--landlord_up`: which agent will play as LandlordUp (the one plays before the Landlord), which can be random, rlcard, douzero, perfectdou, or the path of the pre-trained model\n*   `--landlord_down`: which agent will play as LandlordDown (the one plays after the Landlord), which can be random, rlcard, douzero, perfectdou, or the path of the pre-trained model\n*   `--eval_data`: the pickle file that contains evaluation data\n*   `--num_workers`: how many subprocesses will be used\n\nFor example, the following command evaluates PerfectDou in Landlord position against DouZero agents\n```\npython3 evaluate.py --landlord perfectdou --landlord_up douzero --landlord_down douzero\n```\n\n## Acknowlegements\n*   The demo is mainly based on [RLCard-Showdown](https://github.com/datamllab/rlcard-showdown)\n*   Evaluation code and game environment implementation is mainly based on [DouZero](https://github.com/kwai/DouZero)\n\n## Contact Us\nPlease contact us if you have any problems.\n  \nyangguan@corp.netease.com\n\nminghuanliu@sjtu.edu.cn\n  \nhongweijun@corp.netease.com\n\ngzzengguangjun@corp.netease.com\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNetease-Games-AI-Lab-Guangzhou%2FPerfectDou","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNetease-Games-AI-Lab-Guangzhou%2FPerfectDou","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNetease-Games-AI-Lab-Guangzhou%2FPerfectDou/lists"}