Dualist Othello AI
Dualist is a high-performance Othello (Reversi) AI model trained using a Deep Residual Neural Network architecture. It was developed as part of a hybrid learning project where a bitboard-based engine (Edax) acted as the "Grandmaster Teacher" to train the neural network via curriculum learning.
Features
- Architecture: 10 Residual Blocks with 256 channels.
- Input: 3x8x8 planes (Player bits, Opponent bits, Turn/Constant).
- Heuristics: Trained to emulate professional-level Othello gameplay and strategic positioning.
- Teacher: Supervised and Reinforcement Learning against the Edax engine (Depth 1-30).
Model Details
- Model File:
dualist_model.pth - Total Parameters: Optimized for balancing speed and strategic depth.
- Architecture Class:
OthelloNetinmodel.py.
Installation & Usage
Prerequisites
- Python 3.8+
- PyTorch
- NumPy
Quick Start (Inference)
The model can be loaded and used for move prediction. Make sure model.py, bitboard.py, and dualist_model.pth are in your working directory.
import torch
from model import OthelloNet
from bitboard import get_bit, make_input_planes
# Load model
model = OthelloNet(num_res_blocks=10, num_channels=256)
checkpoint = torch.load("dualist_model.pth", map_location="cpu")
model.load_state_dict(checkpoint["model_state_dict"])
model.eval()
# Example input (Bitboards)
black_bb = 0x0000000810000000
white_bb = 0x0000001008000000
# Get prediction
input_planes = make_input_planes(black_bb, white_bb)
with torch.no_grad():
policy, value = model(input_planes)
# 'policy' contains move probabilities (log_softmax)
# 'value' is the predicted game outcome [-1, 1]
Optimal Performance: MCTS Integration
While the model provides strong "intuitive" moves (Policy Head), it is designed to be used with Monte Carlo Tree Search (MCTS) to reach its full potential. By using the Policy to guide the search and the Value head to prune it, the agent can look ahead multiple turns, making it significantly more "sharp" and strategically sound.
In the provided inference.py and the associated Space, we demonstrate how to use 400-800 simulations per move to achieve Expert/Master level play.
Files Description
dualist_model.pth: Pre-trained weights for the OthelloNet.model.py: Neural Network architecture definition.game.py: Core Othello logic and move generation.bitboard.py: Bit manipulation and input plane processing.mcts.py: Monte Carlo Tree Search implementation (recommended for play).inference.py: Example script to run the model on a board state.
Hugging Face Integration
To push this to your Hugging Face account:
- Install
huggingface_hub:pip install huggingface_hub - Login:
huggingface-cli login - Push files to
brandonlanexyz/dualist.
Created by Brandon | Part of the AntiGravity AI-LAB Othello Project

