Git Product home page Git Product logo

youjiazhang / alphago-zero-gobang Goto Github PK

View Code? Open in Web Editor NEW
69.0 2.0 8.0 13.55 MB

Meta-Zeta是一个基于强化学习的五子棋(Gobang)模型,主要用以了解AlphaGo Zero的运行原理的Demo,即神经网络是如何指导MCTS做出决策的,以及如何自我对弈学习。源码+教程

License: MIT License

Python 100.00%
gobang gui mcts deep-learning residual-networks alphazero alphago tensorflow ai gomuku

alphago-zero-gobang's Introduction

AlphaGo-Zero-Gobang

  • Do you like to play Gobang ?
  • Do you want to know how AlphaGo Zero works ?
  • Check it out!

You can also read my Blog :)

View a Demo

这是一个基于强化学习的自我博弈模型,运行后的程序如下所示。


Quick Start

python3 MetaZeta.py

Train

我们构建了一个基于MCTS进行决策的 AI玩家,由残差神经网络辅助预测落子。

  • 操作:点击 AI 自我对弈,在右上角点击 开始

Test

我们可以和训练有素的 AI玩家 对弈,以测试 AI 的下棋水平。

  • 操作:点击 与 AI对战,在右上角点击 开始

Environment

  • Ubuntu 18.04.6 LTS
  • tensorflow-gpu==2.6.2

File Structure

filename type description
TreeNode.py MCTS nodes of the MCTS decision tree
MCTS.py MCTS Build MCTS decision tree
AIplayer.py MCTS Build an AI based on MCTS+NN
Board.py Board store board information
Game.py Board defines the game process for selfPlay and play-with-Human
PolicyNN.py NN constructs a residual neural network
MetaZeta.py Main GUI synthesis for all parties All in one

How it works (with code explanation)

首先,我们需要设计一些规则来描述棋盘上的信息

然后,我们需要建立一个残差神经网络 (Network structure)

3. MCTS ✨✨✨

然后,我们需要了解 AI 是如何做出决策的。他是如何积累下棋的知识,并利用学到的知识进行下棋的

最后,我们需要了解强化学习的整个过程(即自我对弈 )

alphago-zero-gobang's People

Contributors

youjiazhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

alphago-zero-gobang's Issues

想问下作者windows环境中的配置是怎样的呢

我尝试了1.15.0版本的tensorflow和2.0.0版本的tensorflow,都会出现相应的问题,1.x版本不兼容2.0版本,2.0版本会出现一些1.x的属性,请问作者是怎么解决这个问题的呢?
我需要对代码做出哪些修改呢?
感谢作者!

Training & Performance Question and GPU requirement

Hi,

Thanks for sharing your implementation of AlphaGo Zero.
I was wondering how long does it take to train AlphaGo-zero (RL based) on 9X9? And how long does it get?
Could you share which GPUs did you train on?

Thanks

[Google translation version]
"你好,

感谢分享您对 AlphaGo Zero 的实现。
我想知道在 9X9 上训练 AlphaGo-zero(基于 RL)需要多长时间?它需要多长时间?
你能分享一下你在哪些 GPU 上进行训练吗?

谢谢"

用的tf版本也太老了。。。

ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==2.6.2 (from versions: 2.12.0)
ERROR: No matching distribution found for tensorflow-gpu==2.6.2

請問有沒有興趣製作圍棋遊戲?

你好同學,不知道有沒有興趣製作圍棋引擎,之後參加電腦對局比賽?大概在每年的五到六月左右(下次比賽約半年左右), TCGA 會舉辦多種棋類紙牌的電腦比賽,九路圍棋便是其中之一。參加的方式非常簡單,僅須通過 KGS 伺服器連線比賽即可,無須到場。

如果對此有興趣的話,一些資訊可到這裡查看或是詢問我也行。感謝!

拓展棋盘大小

请问如何增大棋盘大小,为什么self.game.boardWidth直接就是8了

The Conv2D op currently only supports the NHWC tensor format on the CPU. The op was given the format: NCHW

您好
我在克隆你的代码时,发现如上报错无法运行。(一番定位后应该是PolicyNN.py文件中的 act_probs, value = self.model.predict_on_batch(currentBoard) 这句话报错,但是无奈本人水平有限,网上资料甚少,无法解决。)
个人怀疑是环境问题,多次重装readme文件中提及的tensorflow-gpu均无果。故请问是否方便透露下此代码的具体环境,以便克隆复现。

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.