whatisgithub

What is alphazero_gomoku?

junxiaosong/alphazero_gomoku — explained in plain English

Analysis updated 2026-05-18

3,616PythonAudience · researcherComplexity · 3/5Setup · easy

In one sentence

A self-play AI, similar in method to AlphaZero, that learns to play the board game Gomoku and comes with pre-trained models to play against right away.

Mindmap

mindmap
  root((AlphaZero Gomoku))
    What it does
      Self-play training
      Monte Carlo Tree Search
      Play vs trained model
    Tech stack
      Python
      PyTorch
      TensorFlow
      Theano
    Use cases
      Play against AI
      Train your own model
      Study self-play AI
    Audience
      Researchers
      Developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Load a pre-trained model and play a game of Gomoku against it

USE CASE 2

Train your own AI from scratch on a small 6 by 6 board in about two hours

USE CASE 3

Study how Monte Carlo Tree Search combines with self-play to learn a game

USE CASE 4

Compare training speed across the Theano, PyTorch, and TensorFlow backends

What is it built with?

PythonPyTorchTensorFlowTheanoNumPy

How does it compare?

junxiaosong/alphazero_gomokubchao1/bulletmarkfzp/act-plus-plus
Stars3,6163,6163,615
LanguagePythonPythonPython
Setup difficultyeasyeasyhard
Complexity3/52/55/5
Audienceresearcherdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Playing only needs Python and NumPy, training from scratch needs one of three deep learning libraries and hours of compute.

No license terms are stated in the explanation provided.

So what is it?

This project is a Python implementation of AlphaZero, the AI training approach that Google DeepMind used for games like chess and Go, applied to a simpler board game called Gomoku. Gomoku is a two-player game played on a grid where the goal is to be the first to get five pieces in a row, horizontally, vertically, or diagonally. Because Gomoku is much simpler than chess or Go, this version can train a capable AI on an ordinary personal computer in a matter of hours rather than requiring thousands of machines. The training process is entirely self-play: the AI starts with no prior knowledge of good moves and improves purely by playing games against itself, using a search algorithm called Monte Carlo Tree Search to evaluate positions. Over time, the AI gets better at predicting which moves lead to wins, and the stored model files capture that learned knowledge. Once you have a trained model, you can load it and play against it directly by running a single script. The repository comes with four pre-trained model files for different board sizes, so you can start playing immediately without running the training yourself. The training supports three different deep learning backends (Theano with Lasagne, PyTorch, and TensorFlow), and switching between them requires only a small change to one line in a configuration file. For training, the README recommends starting on a small 6-by-6 board with four-in-a-row as the win condition, which can produce a decent model in about two hours. A full 8-by-8 board with five-in-a-row takes roughly two days of continuous training on a single machine. The only requirement to play against an existing model is Python and NumPy, the deep learning libraries are only needed if you want to train from scratch.

Copy-paste prompts

Prompt 1
Help me run the pre-trained Gomoku model in this repo and play a game against it
Prompt 2
Walk me through switching the training backend from Theano to PyTorch in the config
Prompt 3
Explain how Monte Carlo Tree Search is being used to pick moves in this codebase
Prompt 4
Set up a small 6x6 board training run so I can see the AI improve quickly

Frequently asked questions

What is alphazero_gomoku?

A self-play AI, similar in method to AlphaZero, that learns to play the board game Gomoku and comes with pre-trained models to play against right away.

What language is alphazero_gomoku written in?

Mainly Python. The stack also includes Python, PyTorch, TensorFlow.

What license does alphazero_gomoku use?

No license terms are stated in the explanation provided.

How hard is alphazero_gomoku to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is alphazero_gomoku for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.