Coder Social home page Coder Social logo

cglemon / pydlgo Goto Github PK

View Code? Open in Web Editor NEW
53.0 2.0 8.0 12.41 MB

基於深度學習的 GTP 圍棋(围棋)引擎,KGS 指引文件以及演算法教學。

License: MIT License

Python 100.00%
deep-learning mcts weiqi goban baduk alphago game-of-go

pydlgo's Introduction

pyDLGO

The simple English tutorial is Here

自從 AlphaGo 打敗世界冠軍後,電腦圍棋儼然變成深度學習的代名詞,讓不少同學對於電腦圍棋有不小的興趣,但實做一個完整的圍棋引擎並不是只有深度學習而已,還包含許許多多枯燥乏味且需花費大量時間的部份,這令多數同學望而怯步。dlgo 實做一個最低要求的圍棋引擎,它包含圍棋的基本演算法、GTP 界面和 SGF 格式解析器,讓同學可以先跳過這些部份,專注於深度學習,體驗電腦圍棋的魅力。最終目標是希望幫助同學製造屬於自己的圍棋引擎,並參加 TCGA 電腦對局競賽。

(黑) dlgo-0.1 vs (白) Leela-0.11 (黑中盤勝)

vs_leela

使用 Sabaki 分析


Sabaki Analysis

快速開始

開始前請先安裝以下的 python 依賴庫(請注意本程式使用 python3)

  1. PyTorch(1.x 版本,如果要使用 GPU 請下載對應的 CUDA/cuDNN 版本)
  2. NumPy
  3. Tkinter

請輸入下列指令安裝,或自行使用下載可執行的版本

pip3 install -r requirements.txt

完成依賴庫安裝後,首先請先下載本程式碼和預先訓練好的權重,預先訓練好的權重可到 Release 裡找到(為 pt 檔,不需要解壓縮),將權重放到 pyDLGO 的資料夾裡,假設權重的名稱為 nn_2x64.pt ,請輸入以下指令打開圖形界面

$ python3 dlgo.py --weights nn_2x64.pt --gui

文件目錄

  1. 圍棋規則的簡單介紹
  2. 完整的操作教學和 TCGA 比賽
  3. 演算法實做和原理(持續施工中)
  4. GTP 界面原理
  5. SGF 格式說明
  6. board.py 內的 functions
  7. Python 圍棋引擎列表(歡迎添加)

License

本程式為 MIT License ,部份程式有各自的 License ,分別為

Todo

  • 修復 GUI 的 bug 並優化之

聯絡資訊

如果有任何問題或是建議,可以通過 [email protected] 聯繫我。

pydlgo's People

Contributors

cglemon avatar glad-operating-system 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

Watchers

 avatar  avatar

pydlgo's Issues

Complete GTP with ids

pyDLGO/gtp.py

Lines 149 to 154 in d330691

def process(self, cmd):
# TODO: Support analyze and genmove_analyze commands.
main = cmd[0]
if main == "name":
self.success_print("dlgo")

It is not a complete GTP like this:

1 showboard
=1 
    A B C ...
19 
18
...
1

2 play b k10
=2

0 final_score
=0 7.5

5 quit
=5

Here. numbers before commands are ids.

Why are the features designed this way?

pyDLGO/board.py

Line 440 in c237ab6

def get_features(self):

Is the 18-layer feature design following some paper or trying to fit another library? The most direct thought would perhaps be just to output the past 16 boards, and flip the color depending on who is playing (so that the states are symmetric with respect to black/white). Wonder if there is any reason why the current one is used instead.

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.