-
Environment: Used the
python-chess
library for board creation, move validation, checkmate detection, and FEN parsing. -
Initial Approach:
- Attempted to implement a Monte Carlo Tree Search (MCTS) from scratch by generating random moves.
- Created a
TreeNode
class to represent the board state in the tree and backpropagated scores to improve move selection. - However, random moves yielded poor results due to the large search space in chess, so this approach was abandoned.
-
Second Approach:
- Used Stockfish (a powerful chess engine) at a low level to generate promising moves instead of random ones for MCTS.
- Selected the top 5 Stockfish moves to build the tree, which gave better results within the tree itself.
-
Training the Policy Network:
- Collected data from the MCTS tree to train the policy network.
- Used sequences of 8 board states as inputs and the corresponding best move as outputs, following AlphaZero’s method.
- Encoded boards in binary and used 1969 output classes for possible moves.
-
Challenges:
- Limited compute resources restricted the size of the Monte Carlo tree and the number of training iterations.
-
Results:
- Despite limited training, the policy network showed improvement over random play.
- Developed code to use the trained model to create a new Monte Carlo tree for further iterations, though compute constraints prevented full execution.
-
Next Steps:
- With better compute resources, the iterative training process can continue to further improve the model.
- The bot can now play against a human or another model, with potential for further enhancements.
-
Notifications
You must be signed in to change notification settings - Fork 0
Sohaib-Ahmed21/Chess_Bot_Reinforcement_Learning
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Implementation of Chess bot through Reinforcement Learning
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published