神刀安全网

Facebook's DarkForest Go AI Now on GitHub

Facebook DarkForest Go Project

Build

Dependency:

  1. Install torch7 .
  2. Install luarocks: class, image, tds, cudnn

For Cudnn, please install the driver from NVidia. This program supports 1-4 GPUs.

Then just compile with the following command:

sh ./compile.sh

GCC 4.8+ is required. Depending on the location of your C++ compiler, please change the script accordingly. Tested in CentOS 6.5.

Usage

Step 1: Download the models.

Create ./models directory and download trained models .

Step 2: First run the GPU server

cd ./local_evaluator      sh cnn_evaluator.sh [num_gpu] [pipe file path]
  • num_gpu the number of GPUs (1-8) you have for the current machine.
  • pipe file path The path that the pipe file is settled. Default is /data/local/go . If you have specific other path, then you need to specify the same when running cnnPlayerMCTSV2.lua

Example: sh cnn_evaluator.sh 4 /data/local/go

Step 3: Run the main program

cd ./cnnPlayerV2      th cnnPlayerMCTSV2.lua [options]

See cnnPlayerV2/cnnPlayerMCTSV2.lua for a lot of options. For a simple first run (assuming you have 4 GPUs), you could use:

th cnnPlayerMCTSV2.lua --num_gpu [num_gpu] --time_limits 10

or

th cnnPlayerMCTSV2.lua --use_formal_params --time_limits 10

To load an existing game up to move 23:

th cnnPlayerMCTSV2.lua [other_options] --setup_board "/path/to/sgf 23"

When you are in the interactive environment, type

  • clear_board to clear the board
  • genmove b to genmove the black move.
  • play w Q4 to play a move at Q4 for specific color.
  • quit to quit.

A complete game may look like:

clear_board [MCTS initialization ...] place_free_handicap 3 genmove b  [MCTS generates moves..e.g., it returns Q16] play w D4 genmove b [MCTS generates moves...] quit

For more commands, please use command list_commands , check the details of GTP protocol or take a look at the source code.

Award

  • Stable KGS 5d . link
  • 3rd place in KGS Go Tournament. link
  • 2nd place in UEC Computer Go Cup. link

Trouble Shooting

Q: My program hanged on genmove/quit, what happened?

A: Make sure you run the GPU server under ./local_evaluator, the server remains active and the pipe file path matches between the server and the client.

If you have any questions or find any bugs, please open a Github issue by clicking "Issues" tab and then click "New Issue" .

Code Overview

The system consists of the following parts.

  • ./CNNPlayerV2
    Lua (terminal) interface for Go.

  1. CNNPlayerV3.lua Run Pure-DCNN player
  2. CNNPlayerMCTSV2.lua Run player with DCNN + MCTS

  • ./board
    Things about board and its evaluations. Board data structure and different playout policy.

  • ./mctsv2
    Implementation of Monte Carlo Tree Search

  • ./local_evaluator
    Simple GPU-based server. Communication with search threads via pipe.

  • ./utils
    Simple utilities, e.g., read/write sgf files.

  • ./test
    Test utilities.

  • ./train
    Training code (will be released soon).

  • ./models
    All pre-trained models. Please download them here and save to the ./models directory.

  • ./sgfs Some exemplar sgf files.

License

Please check LICENSE file for the license of Facebook DarkForest Go engine.

Acknowledgement

Although DarkForest is standalone and does not depend on external libraries, some portions of the tactics and pattern code were inspired by Pachiengine.

Reference

If you use the pre-trained models or any engine, please reference the following paper:

Better Computer Go Player with Neural Network and Long-term Prediction, ICLR 2016   Yuandong Tian, Yan Zhu 

Here is the arxiv link

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Facebook's DarkForest Go AI Now on GitHub

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址