Coder Social home page Coder Social logo

twelveshogi_alphazero's Introduction

TwelveShogi_AlphaZero

Author

  • Xingye Xu

Training is in progress.

A simplified version of Shogi with the AI is trained by alpha-zero-type training method

This project is based on these main resources:

  1. DeepMind's Oct 19th publication: Mastering the Game of Go without Human Knowledge.
  2. The great Gomoku development of the DeepMind ideas that @junxiaosong did in his repo: https://github.com/junxiaosong/AlphaZero_Gomoku
  3. The wonderful Chess development of the DeepMind ideas that @Zeta36 did in his repo: https://github.com/Zeta36/chess-alpha-zero/
  4. The brilliant Reversi development of the DeepMind ideas that @mokemokechicken did in his repo: https://github.com/mokemokechicken/reversi-alpha-zero
  5. DeepMind just released a new version of AlphaGo Zero (named now AlphaZero) where they master chess from scratch: https://arxiv.org/pdf/1712.01815.pdf.

TwelveShogi

TwelveShogi comes from the TV series -- The Genius:_Black_Garnet (https://en.wikipedia.org/wiki/The_Genius:_Black_Garnet) in which named as "Twelve Jangqi". The board is looked like follows:

image

The rules list as follows:

The game played by two players. We defined the player move direction is the player's color which means the top side player is playing down color and the down side player is playing up color.

All shogimans can only move one grid by one step at any direction. Any shogiman that has been catched is put in the prison. The prisoners can be put in the board instead of move a shogiman. However, the prisoners cannot be put at the opposite colored area(which means the opposite side's bottom row).

Zi(子): can only go forward. And when the Zi reached the opposite colored area it will be promoted to Hou(侯)

Jiang(将): can go forward, back, left and right.

Xiang(相): can go NW, NE, SW and SE.

Wang(王): can go every direction.

Hou(侯): can go any direction except SW and SE for up color.

Tips: every shogiman has little pots in the pictures which represent the directions where the shogiman can move to.

The game is end when the Wang is catched by the other player or the Wang reached the opposite colored area and live for a round or tie when 40 moves are taken by two players together(I defined it, can be changed).

Usage

Training

python train.py

Tips: I don't have a computer with an available GPU for deep training. Therefore, it's very slow for me to train a model. It's strongly recommended that use a GPU to train this model.

Play

with yourself or another person: python TwelveShogi.py -c [0 or 1] -m 0

with computer(after you trained a model): python TwelveShogi.py -c [0 or 1] -m 1

watch computer selfplay(after you trained a model and maybe a lot of bugs): python TwelveShogi.py -c [0 or 1] -m 2

Requirments

Python >= 2.7 Numpy >= 1.11 Theano >= 0.7 Lasagne >= 0.1

twelveshogi_alphazero's People

Contributors

planetmoon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.