Code Monkey home page Code Monkey logo

du-guai's Introduction

du-guai

基于机器学习的斗地主算法程序,我们一般只会用两个字来形容这种AI:赌怪!

环境依赖

  • python >= 3.7
  • numpy
  • pytest
  • sklearn

启动方式

运行主程序

cd duguai
python main.py

运行Q-Learnig脚本训练数据

cd script

# Q-Learning模型训练
python q_learning.py -t <训练次数>

运行基准测试

cd script

python benchmark.py -t <需要测试的AI的训练次数>

项目目录说明

  • duguai:程序源代码目录。main.py是入口程序
  • dataset:数据集目录
  • doc:项目文档
  • notebook:ipython notebook目录
  • script:一些脚本程序(如数据生成脚本)
  • test:单元测试

配置说明

配置文件为duguai/.env

调试/生产模式:mode = debug/prod 开启/关闭测试:test = on/off

算法设计

ALGORITHM.md

斗地主规则

RULES.md

训练结果

对局1000次的基准测试

智能体 地主获胜场次 农民获胜场次 总获胜场次 胜率
QLAgent (训练400次,约26秒) 176 370 546 54.6%
RandomAgent1 148 337 485 48.5%
RandomAgent2 155 335 490 49.3%
智能体 地主获胜场次 农民获胜场次 总获胜场次 胜率
QLAgent (训练1000次,约64秒) 155 395 550 55.5%
RandomAgent1 122 385 507 50.7%
RandomAgent2 143 380 523 52.3%
智能体 地主获胜场次 农民获胜场次 总获胜场次 胜率
QLAgent (训练2000次,约128秒) 141 403 544 54.4%
RandomAgent1 134 383 517 51.7%
RandomAgent2 148 368 516 51.6%
智能体 地主获胜场次 农民获胜场次 总获胜场次 胜率
QLAgent (训练5000次,约325秒) 174 382 566 56.6%
RandomAgent1 123 378 501 50.1%
RandomAgent2 132 382 514 51.4%
智能体 地主获胜场次 农民获胜场次 总获胜场次 胜率
QLAgent (训练10000次,约643秒) 167 392 559 55.9%
RandomAgent1 120 399 519 51.9%
RandomAgent2 127 381 508 50.8%
智能体 地主获胜场次 农民获胜场次 总获胜场次 胜率
QLAgent(训练60000次,约3906秒) 163 407 570 57.0%
RandomAgent1 138 352 490 49.0%
RandomAgent2 147 345 492 49.2%
智能体 地主获胜场次 农民获胜场次 总获胜场次 胜率
QLAgent(训练18万次,约11700秒) 166 396 562 56.2%
RandomAgent1 143 366 509 50.9%
RandomAgent2 120 380 500 50.0%

du-guai's People

Contributors

jiangyinzuo avatar sophiscaty-c avatar u-rara avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

du-guai's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.