Giter Site home page Giter Site logo

mzy2240 / gomoku-deep-learning Goto Github PK

View Code? Open in Web Editor NEW

This project forked from slcz/gomoku-deep-learning

0.0 1.0 0.0 120.07 MB

gomoku AI with deep learning and monte carlo tree search

License: GNU General Public License v3.0

Python 86.66% JavaScript 12.80% HTML 0.54%

gomoku-deep-learning's Introduction

Gomoku game with DQN and Monte Carlo Tree Search (MCTS)

Gomoku game written in tensorflow, trained with Cnn and using MCTS rollout to play. MCTS part needs more debugging and is better turned off. You can get a reasonably strong AI player (<15x15 board) with just deep neural netowrk prediction.

Requirement

The model is trained on single Nvidia 1080 GTX, with tensorflow 1.0 and python 3. Pyhton packages required: - numpy - flask - tensorflow

Basic Usage:

  • Play with pretrained model, should be reasonable at e.g. 11x11, 15x15 board size. This only uses Dqn network, no searching involved!
python gomoku.py --agent1 web --agent2 dqntest --agent2_model G20 --web --boardsize 11 # Browser points to http://127.0.0.1:5000 to play a game with AI.
  • Training models with default parameters. The script repeatedly searches for the latest (greatest?) model under saved_models and randomly selects an opponent model for training.
    $ ./train.py
  • AI using MCTS against human opponent using a pretrained model.
    $ ./gomoku.py --agent1 montecarlo --agent2 web --agent1_model G79 --boardsize 15 --web

The example uses pretrained model G79. Use http://:5000 to connect to the game engine.

  • Play using pretrained model without MCTS search.
    $ ./gomoku.py --agent1 web --agent2 dqntest --agent2_model G79 --boardsize 15 --web
  • Two AIs against each other
    $ ./gomoku.py --agent1 montecarlo --agent2 montecarlo --agent1_model G78 --agent2_model G79 --boardsize 15 --web
  • Two AI players and AI visualization
    $ ./gomoku.py --agent1 montecarlo --agent2 montecarlo --agent1_model G78 --agent2_model G79 --boardsize 15 --web --display_AI

Demo

gomoku-deep-learning's People

Contributors

slcz avatar chrislambert avatar

Watchers

James Cloos 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.