brandonlanexyz commited on
Commit
1f05d29
·
verified ·
1 Parent(s): 9deb5ea

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +91 -70
README.md CHANGED
@@ -1,70 +1,91 @@
1
- # Dualist Othello AI
2
-
3
- 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.
4
-
5
- ## Features
6
- - **Architecture**: 10 Residual Blocks with 256 channels.
7
- - **Input**: 3x8x8 planes (Player bits, Opponent bits, Turn/Constant).
8
- - **Heuristics**: Trained to emulate professional-level Othello gameplay and strategic positioning.
9
- - **Teacher**: Supervised and Reinforcement Learning against the Edax engine (Depth 1-30).
10
-
11
- ## Model Details
12
- - **Model File**: `dualist_model.pth`
13
- - **Total Parameters**: Optimized for balancing speed and strategic depth.
14
- - **Architecture Class**: `OthelloNet` in `model.py`.
15
-
16
- ## Installation & Usage
17
-
18
- ### Prerequisites
19
- - Python 3.8+
20
- - PyTorch
21
- - NumPy
22
-
23
- ### Quick Start (Inference)
24
- 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.
25
-
26
- ```python
27
- import torch
28
- from model import OthelloNet
29
- from bitboard import get_bit, make_input_planes
30
-
31
- # Load model
32
- model = OthelloNet(num_res_blocks=10, num_channels=256)
33
- checkpoint = torch.load("dualist_model.pth", map_location="cpu")
34
- model.load_state_dict(checkpoint["model_state_dict"])
35
- model.eval()
36
-
37
- # Example input (Bitboards)
38
- black_bb = 0x0000000810000000
39
- white_bb = 0x0000001008000000
40
-
41
- # Get prediction
42
- input_planes = make_input_planes(black_bb, white_bb)
43
- with torch.no_grad():
44
- policy, value = model(input_planes)
45
-
46
- # 'policy' contains move probabilities (log_softmax)
47
- # 'value' is the predicted game outcome [-1, 1]
48
- ```
49
-
50
- ### Optimal Performance: MCTS Integration
51
- 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.
52
-
53
- 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.
54
-
55
- ### Files Description
56
- - `dualist_model.pth`: Pre-trained weights for the OthelloNet.
57
- - `model.py`: Neural Network architecture definition.
58
- - `game.py`: Core Othello logic and move generation.
59
- - `bitboard.py`: Bit manipulation and input plane processing.
60
- - `mcts.py`: Monte Carlo Tree Search implementation (recommended for play).
61
- - `inference.py`: Example script to run the model on a board state.
62
-
63
- ## Hugging Face Integration
64
- To push this to your Hugging Face account:
65
- 1. Install `huggingface_hub`: `pip install huggingface_hub`
66
- 2. Login: `huggingface-cli login`
67
- 3. Push files to `brandonlanexyz/dualist`.
68
-
69
- ---
70
- *Created by Brandon | Part of the AntiGravity AI-LAB Othello Project*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ - sv
6
+ metrics:
7
+ - accuracy
8
+ tags:
9
+ - othello
10
+ - reinforcement-learning
11
+ - alphazero
12
+ - edax
13
+ - board-games
14
+ ---
15
+ # Dualist Othello AI
16
+
17
+ 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.
18
+
19
+ ## Features
20
+ - **Architecture**: 10 Residual Blocks with 256 channels.
21
+ - **Input**: 3x8x8 planes (Player bits, Opponent bits, Turn/Constant).
22
+ - **Heuristics**: Trained to emulate professional-level Othello gameplay and strategic positioning.
23
+ - **Teacher**: Supervised and Reinforcement Learning against the Edax engine (Depth 1-30).
24
+
25
+ ## Model Details
26
+ - **Model File**: `dualist_model.pth`
27
+ - **Total Parameters**: Optimized for balancing speed and strategic depth.
28
+ - **Architecture Class**: `OthelloNet` in `model.py`.
29
+
30
+ ## Installation & Usage
31
+
32
+ ### Prerequisites
33
+ - Python 3.8+
34
+ - PyTorch
35
+ - NumPy
36
+
37
+ ### Quick Start (Inference)
38
+ 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.
39
+
40
+ ```python
41
+ import torch
42
+ from model import OthelloNet
43
+ from bitboard import get_bit, make_input_planes
44
+
45
+ # Load model
46
+ model = OthelloNet(num_res_blocks=10, num_channels=256)
47
+ checkpoint = torch.load("dualist_model.pth", map_location="cpu")
48
+ model.load_state_dict(checkpoint["model_state_dict"])
49
+ model.eval()
50
+
51
+ # Example input (Bitboards)
52
+ black_bb = 0x0000000810000000
53
+ white_bb = 0x0000001008000000
54
+
55
+ # Get prediction
56
+ input_planes = make_input_planes(black_bb, white_bb)
57
+ with torch.no_grad():
58
+ policy, value = model(input_planes)
59
+
60
+ # 'policy' contains move probabilities (log_softmax)
61
+ # 'value' is the predicted game outcome [-1, 1]
62
+ ```
63
+
64
+ ### Optimal Performance: MCTS Integration
65
+ 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.
66
+
67
+ 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.
68
+
69
+ ### Files Description
70
+ - `dualist_model.pth`: Pre-trained weights for the OthelloNet.
71
+ - `model.py`: Neural Network architecture definition.
72
+ - `game.py`: Core Othello logic and move generation.
73
+ - `bitboard.py`: Bit manipulation and input plane processing.
74
+ - `mcts.py`: Monte Carlo Tree Search implementation (recommended for play).
75
+ - `inference.py`: Example script to run the model on a board state.
76
+
77
+ ## Hugging Face Integration
78
+ To push this to your Hugging Face account:
79
+ 1. Install `huggingface_hub`: `pip install huggingface_hub`
80
+ 2. Login: `huggingface-cli login`
81
+ 3. Push files to `brandonlanexyz/dualist`.
82
+
83
+
84
+ https://cdn-uploads.huggingface.co/production/uploads/65fc3d2c2ba04e5ae4f1c1c6/UkwcYLNdpBffFM3JKN1mL.mp4
85
+
86
+ ![unnamed (8)](https://cdn-uploads.huggingface.co/production/uploads/65fc3d2c2ba04e5ae4f1c1c6/zweaGRBtn5pJi423pBl-e.png)
87
+
88
+ ![unnamed (9)](https://cdn-uploads.huggingface.co/production/uploads/65fc3d2c2ba04e5ae4f1c1c6/5dA0JBEjyojgqJfIIkSVV.png)
89
+
90
+ ---
91
+ *Created by Brandon | Part of the AntiGravity AI-LAB Othello Project*