OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Alphazero Gomoku

Alphazero Gomoku is an open-source Python implementation of AlphaZero-style Gomoku, using self-play reinforcement learning, a policy-and-value network and Monte Carlo tree search to train an agent and play the board game.

Independent OpenViST project profile, based on linked sources.

Alphazero Gomoku — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when you want a compact board-game project for exploring AlphaZero-style self-play, or a Python implementation to play against and adapt. Start with provided models if the aim is to play; choose a training backend and board configuration if the aim is to experiment with learning.

Who it is for

  • Developers learning how self-play reinforcement learning and Monte Carlo tree search can be combined in a board-game AI.
  • Gomoku players who want to play against the project’s provided trained models.
  • Researchers or students experimenting with policy-value networks and alternative training backends.

Documented uses

  • Play Gomoku against a provided trained AI model.
  • Train a Gomoku policy-and-value model through self-play.
  • Explore or modify MCTS-based move selection and compare supported neural-network backends.
Before you choose

Requirements & limits

The repository is public and MIT-licensed. Playing with provided models requires Python 2.7 or later and NumPy 1.11 or later; training additionally requires one of the documented deep-learning stacks.

  • Playing has fewer prerequisites than training: Python and NumPy are listed for the provided models, while training needs Theano/Lasagne, PyTorch or TensorFlow.
  • Theano/Lasagne is the documented direct training path; PyTorch and TensorFlow require editing train.py to switch the policy-value network import.
  • The provided models were trained with Theano/Lasagne, and the README points to a separate issue for using them with PyTorch.
  • Training time depends on the configuration: the README estimates about two hours for a 6 × 6 board with four in a row, versus about two days for an 8 × 8 board with five in a row on a single PC.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Play against a provided Gomoku model

Start a local game against one of the repository’s provided trained models.

Before you start

  • Python 2.7 or later
  • NumPy 1.11 or later
  • The repository files and provided model files

Steps

  1. From the project directory, run the command below.

    Documented command
    python human_play.py
  2. Modify human_play.py if you want to select another provided model or try pure MCTS.

Expected outcome

A playable session against the selected trained AI or pure MCTS.

Guide limitations

  • The four provided models were trained with Theano/Lasagne; using them with PyTorch requires consulting the project’s issue 5 reference.
Source-based practical guide

Select a backend before training

Configure the documented training script to use the PyTorch or TensorFlow policy-value network.

Before you start

  • Python environment with either PyTorch 0.2.0 or later, or TensorFlow
  • The project repository

Steps

  1. Open train.py.

  2. Comment out the Theano/Lasagne PolicyValueNet import.

  3. Uncomment the import for the PyTorch or TensorFlow policy-value network.

  4. Run the command below.

    Documented command
    python train.py

Expected outcome

The training script is configured to use the selected backend and can begin training.

Guide limitations

  • The README gives a direct python train.py instruction for Theano/Lasagne; PyTorch and TensorFlow require the import change first.
  • GPU use with PyTorch has additional version-specific code notes in the README.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
16 October 2026
Original website title
junxiaosong/AlphaZero_Gomoku · Official homepage title · retained in its source language