https://github.com/ianivkk/tictactoedqn
https://github.com/ianivkk/tictactoedqn
deep-q-learning educational-project game-ai keras machine-learning monte-carlo python q-learning reinforcement-learning tensorflow tic-tac-toe
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ianivkk/tictactoedqn
- Owner: IanivKK
- Created: 2025-07-13T07:06:07.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-15T19:11:03.000Z (12 months ago)
- Last Synced: 2025-07-26T04:26:19.712Z (12 months ago)
- Topics: deep-q-learning, educational-project, game-ai, keras, machine-learning, monte-carlo, python, q-learning, reinforcement-learning, tensorflow, tic-tac-toe
- Language: Jupyter Notebook
- Homepage:
- Size: 21.7 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tic-Tac-Toe Reinforcement Learning Agents
This repository contains implementations of three RL agents for Tic-Tac-Toe:
- Monte Carlo
- Q-Learning
- Deep Q-Network (DQN) (with optional Double DQN)
## Setup
```bash
pip install numpy tqdm tensorflow pytest jupyter
```
## Structure
```
tic_tac_toe_rl/
├── README.md
├── requirements.txt
├── config.py
├── env.py
├── train.py
├── evaluate.py
├── agents/
│ ├── __init__.py
│ ├── monte_carlo_agent.py
│ ├── q_learning_agent.py
│ └── dqn_agent.py
├── tests/
│ ├── test_env.py
│ └── test_agents.py
└── notebooks/
└── Project_4_TicTacToe-Ianivkk.ipynb
```
## Training
```bash
python train.py --agent mc --episodes 100000
python train.py --agent q --episodes 200000
python train.py --agent dqn --episodes 50000
```
## Evaluation
Play mode:
```bash
python evaluate.py --agent mc --mode play --games 1000 --model models/mc_model.pkl
```
Hyperparameter tests:
```bash
python evaluate.py --agent all --mode test_hyper_param \
--param-name epsilon --param-values 0.1,0.35,0.7,1.0 \
--episodes 50000 --games 1000
```