Coder Social home page Coder Social logo

aichess's Introduction

aichess

使用alphazero算法打造属于你自己的象棋AI

一、每个文件的意义

collect.py 自我对弈用于数据收集

train.py 用于训练模型

game.py 实现象棋的逻辑

mcts.py 实现蒙特卡洛树搜索

paddle_net.py,pytorch_net.py 神经网络对走子进行评估

play_with_ai.py 人机对弈print版

UIplay.py GUI界面人机对弈

二、提供了两个框架的版本进行训练:

使用pytorch版本请设置config.py 中CONFIG['use_frame'] = 'pytorch',

使用pytorch版本请设置config.py 中CONFIG['use_frame'] = 'paddle'。

不管是使用哪个框架,都一定要安装gpu版本,而且要用英伟达显卡,因为我们蒙特卡洛一次走此要进行上千次的神经网络推理,所以必须要快!

三、本项目是多进程同步训练。

训练时,在终端运行python collect.py用于自我对弈产生数据,这个可以多开。

然后,在终端运行python train.py用于模型训练,这个终端只用开一个。

四、相关资源链接

B站视频链接:https://www.bilibili.com/video/BV183411g7GX

知乎文章:https://zhuanlan.zhihu.com/p/528824058?

aistudio上一键可运行项目:https://aistudio.baidu.com/aistudio/projectdetail/4215743 (可以使用免费的V100来进行训练)

五、参考与致谢

本项目主要参考的资料如下,十分感谢大佬们的分享 1、程世东 https://zhuanlan.zhihu.com/p/34433581 (**象棋cchesszero )

2、AI在打野 https://aistudio.baidu.com/aistudio/projectdetail/1403398 (用paddle打造的五子棋AI)

3、junxiaosong https://github.com/junxiaosong/AlphaZero_Gomoku (五子棋alphazero)

4、书籍:边做边学深度强化学习:PyTorch 程序设计实践

5、书籍:强化学习第二版

后续应该会对该AI继续训练下去,亲手造一个超强的下棋AI简直太酷了!

aichess's People

Contributors

socool1345 avatar tensorfly-gpu avatar

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.