CoolFace
Apppublic

OpenDILabCommunity/DI-sheep

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
7likes
README.md104 linesDownload Raw Back to DI-sheep
1# DI-sheep:深度强化学习 + 羊了个羊2 3当 AI 技术的明珠——深度强化学习,遇到号称“通关率只有0.01%”的游戏“羊了个羊”,会碰撞出哪些奇思妙想呢?4 5P.S. 路过记得点个 star ![stars - di-sheep](https://img.shields.io/github/stars/opendilab/di-sheep?style=social) ,持续更新ing。6 7P.S.S. 想了解更多深度强化学习相关知识?快来 [DI-engine](https://github.com/opendilab/DI-engine) 训练自己的智能体。8 9<div align="center">10    <a href="https://github.com/opendilab/DI-sheep"><img width="500px" height="auto" src="https://github.com/opendilab/DI-sheep/blob/master/ui/public/demo.gif"></a>11</div>12 13# News14- [bilibili] [羊群加不进去?那就来加猫群叭!深度强化学习版的羊了个羊来了](https://www.bilibili.com/video/BV1N24y1o7Lw/?spm_id_from=333.999.0.0)15- [WeChat] [万事开头难?喵小DI玩“羊了个羊”可不难](https://mp.weixin.qq.com/s/4Z3WtkcWRp6x4x60RVELfQ)16 17# 使用指南18 19## 算法原理解析20![disheep drawio](https://user-images.githubusercontent.com/33195032/191955286-7c309e9d-6e35-491f-93b3-b14cd1fe033f.png)21 22## 快速上手23 24- 如果想**在线试玩** --> [在线网页(改进中)](https://opendilab.net/sheep)25- 如果想**本地部署/测试**26  - 服务端(Python)27    ```shell28    # 预先安装好 Python329    cd service30    pip install -r requirement.txt31    FLASK_APP=app.py flask run  # 玩家试玩32    # FLASK_APP=agent_app.py flask run  # 玩家 + AI 试玩33    ```34  - 客户端(react)35    ```shell36    # 预先安装好 node.js 和 react37    cd ui38    npm run build39    npm run preview40    ```41    然后在网页中打开对应链接即可42- 如果想进行完整的深度强化学习训练43    ```shell44    # 预先安装好 Python345    cd service46    pip install -r requirement-train.txt47    python3 -u sheep_ppo_main.py48    ```49- 如果想使用定义好的 gym 羊了个羊环境 --> 点个 star 之后直接暴力 CTRL C+V 拿走 `service/sheep_env.py` 尽情魔改50- 如果想获得训练好的深度强化学习模型 --> 访问 [OpenDILab官网下载链接](https://opendilab.net/download/DI-sheep/) (目前提供了两种试玩模型,但智能体仍有很多进步空间)51- 如果想了解更多深度强化学习相关知识 --> 欢迎参阅 [DI-engine](https://github.com/opendilab/DI-engine) 和[相关文档](https://di-engine-docs.readthedocs.io/zh_CN/latest/)52- 如果想了解未来的更新计划 --> 请参阅[更新计划](#更新计划)53- 如果有其他问题或想法 --> 欢迎 github ISSUE 区讨论,或是贡献 Pull requests54 55## 项目结构56```text57.58├── LICENSE59├── ui                       --> react 网页前端60└── service                  --> Python 核心模块(算法和服务端)61    ├── app.py                  --> flask 服务 app (仅人类操作)62    ├── agent_app.py                  --> flask 服务 app(人类+AI操作)63    ├── requirement.txt         --> Python 依赖库列表64    ├── sheep_env.py            --> gym 格式环境65    ├── sheep_model.py          --> 基于 PyTorch 的 Actor-Critic 神经网络模型66    ├── sheep_ppo_main.py       --> 基于 DI-engine 的深度强化学习训练主函数67    ├── test_sheep_env.py       --> gym 格式环境的单元测试68    └── test_sheep_model.py     --> 神经网络模型的单元测试69```70 71 72 73# 更新计划74 75## 算法76 77- [ ] 强化学习训练参数调整和算法微调78- [ ] 提供可供本地试玩的模型权重79- [ ] 详细的神经网络和强化学习算法设计文档80- [ ] model-based RL 和 planning 算法81- [ ] 神经网络压缩(用于部署) 82 83## 环境84- [ ] 添加原类型游戏(比如3tiles)中的各种道具85- [ ] 牌的层数问题如何定义86- [ ] 结合 JAX 优化环境运行速度87- [ ] 更多结合 AI 的玩法设计88 89 90## 应用91- [x] 更多自定义主题和 BGM92- [x] 在线网页端部署93- [x] 样例神经网络权重下载94- [ ] 更多 AI 训练时的行为分析95- [ ] 移动端应用(欢迎Android/IOS开发者支持)96 97 98# 致谢99- react 前端部分主要参考 https://github.com/StreakingMan/solvable-sheep-game ,请大家也多多支持这个 repo 100 101 102# License103DI-sheep is released under the Apache 2.0 license.104