Reinforcement-learning agents that learn Tic-Tac-Toe from scratch by self-play, built for a Foundations of AI course project. The flagship model combines the full modern DQN toolkit — Double DQN, Dueling architecture, NoisyNet exploration, and Prioritized Experience Replay — plus a hand-playable unbeatable minimax opponent for comparison, in Python and C.
- Double DQN — the policy net picks the action, the target net evaluates it (kills the overestimation bias of vanilla DQN)
- Dueling — separate value (V) and advantage (A) streams share one encoder
- NoisyNet — learnable exploration noise replaces epsilon-greedy
- PER — replay transitions sampled ∝ TD-error, corrected by importance-sampling weights
pip install -r requirements.txt # torch, numpy, matplotlib
python FAI_proj_S3/fai.py # train via self-play + live dashboard
python FAI_proj_S3/7.py # play vs. unbeatable minimax (tkinter)
# C + raylib version of the minimax game
cc -o fai_2/tictactoe fai_2/main.c -lraylib && ./fai_2/tictactoeCUDA is used automatically when available; otherwise CPU.


