A reinforcement learning implementation for the game of Checkers.
First ensure you have Python 3.x installed on your system. Then you can run the commands in your terminal:
# Create a virtual environment
python -m venv venv
# Activate the virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activateThe project requires several dependencies for deep learning, scientific computing, and data processing. Install them using:
pip install -r requirements.txtThe training process involves two main components:
To start the training process:
python training.pyThe script supports four training modes, controlled by modifying the Oppenent variable in training.py:
"itself"- Self-play training"curriculum"- Adaptive difficulty opponent"minmax"- Minimax algorithm opponent"random"- Random move opponent
To switch between modes:
- Open
training.py - Find this section at the bottom of the file:
if "__main__" == __name__ :
Oppenent = "curriculum" # Change this value to your desired mode
print(Oppenent)
GetModel(Oppenent=Oppenent)- Change
"curriculum"to any of:"itself","minmax", or"random" - Save and run
python training.py
Each mode will:
- Save the model to
models/{mode}aa.keras - Generate statistics in
winrates_{mode}.csv - Create visualization in
final_results/training/
To evaluate trained models:
- Navigate to and open
round_robin.ipynb - Run all cells in the notebook
The notebook will:
- Load trained models from different checkpoints
- Conduct round-robin tournaments with 100 games between each agent
- Generate performance comparisons
- Visualize results with matplotlib
checkers.py: Core game implementation with game logic and state managementtraining.py: Main reinforcement learning training scriptround_robin.ipynb: Jupyter notebook for model evaluationrequirements.txt: Complete list of project dependencies