This project implements a game-playing agent based on the AlphaZero algorithm, inspired by the DeepMind paper "Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm". The agent is designed to play games with itself and learn through reinforcement learning. The agent generates data based on modified MCTS tree search algorithm and trains itself on the generated data.
- Google DeepMind
- Mastering the game of Go without human knowledge
- Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm
- Human-level control through deep reinforcement learning
- Self-play: The agent plays games against itself to generate training data.
- Neural Network: Implements a neural network for the game-playing policy and value estimation.
- Reinforcement Learning: Utilizes reinforcement learning techniques for training the agent.
- Game Environment: Support for multiple game environments (TicTacToe, ConnectFour, etc.).
- Data Creation: Create and Save game data for model to be trained on.
- Make sure you are running python version of 3.8 - 3.11.
- Clone the repository:
git clone https://github.com/amanmoon/general_alpha_zero.git
- Navigate to the project directory:
cd general_alpha_zero
- Install dependencies:
pip install -r requirements.txt
- Navigate to the project directory:
cd general_alpha_zero
- Create Virtual Environment:
python3.10 -m venv <venv Name>
- Activate Virtual Environment:
source <venv Name>/bin/activate
- Deactivate Virtual Environment:
deactivate
- Choose Game you wish to Train Model for and import right Classes inside the Train.py file.
- Choose appropriate hyperparameters in args.
- To run the Train Script:
python3 Train.py
- Choose player you wish to play as and modify search parameters in args inside the Play.py file.
- Import Correct Model.
- To run the Play Script:
python3 Play.py
- Choose Models you wish to bet against each other inside the Arena file.
- To run the Arena Script:
python3 Arena.py
For questions or suggestions, feel free to reach out at [email protected].