The simple English tutorial is Here
自從 AlphaGo 打敗世界冠軍後,電腦圍棋儼然變成深度學習的代名詞,讓不少同學對於電腦圍棋有不小的興趣,但實做一個完整的圍棋引擎並不是只有深度學習而已,還包含許許多多枯燥乏味且需花費大量時間的部份,這令多數同學望而怯步。dlgo 實做一個最低要求的圍棋引擎,它包含圍棋的基本演算法、GTP 界面和 SGF 格式解析器,讓同學可以先跳過這些部份,專注於深度學習,體驗電腦圍棋的魅力。最終目標是希望幫助同學製造屬於自己的圍棋引擎,並參加 TCGA 電腦對局競賽。
開始前請先安裝以下的 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
本程式為 MIT License ,部份程式有各自的 License ,分別為
如果有任何問題或是建議,可以通過 [email protected]
聯繫我。
預先訓練好的十九路權重,強度約 10 級,config.py
參數如下
BOARD_SIZE = 19 # The default and max board size. We can reset the value later.
KOMI = 7.5 # The default komi. We can reset the value later.
USE_GPU = True # Set true will use the GPU automatically if you have one.
BLOCK_SIZE = 2 # The network residual block size.
BLOCK_CHANNELS = 64 # The number of network residual channels.
POLICY_CHANNELS = 8 # The number of value head channels.
VALUE_CHANNELS = 4 # The number of policy head channels.
INPUT_CHANNELS = 18 # Number of the network input layers.
PAST_MOVES = 8 # Number of past moves encoding to the planes.
USE_SE = False # Enable Squeeze-and-Excite net struct.
USE_POLICY_ATTENTION = False # Enable self-attention net struct.
預先訓練好的小型權重,使用預設的訓練集和網路大小,無須更改 config.py 即可使用,
deep-learning mcts weiqi goban baduk alphago game-of-go