Skip to content

Instantly share code, notes, and snippets.

View SalahEddineGhamri's full-sized avatar
🎯
tic tac toe

Salah SalahEddineGhamri

🎯
tic tac toe
View GitHub Profile
@SalahEddineGhamri
SalahEddineGhamri / simple_q_learning.py
Created December 7, 2025 01:00
a simple q learning implementation in python
"""
Simple Q learning algorithm with epsilon-greedy action choice
in q-learning algorithm we maintain a table of stats-actions q-values
after attributing the rewards to the goal states
the table is update based on bellman learning formula
to propagate the q values on the state-action back to the start
learning is done through episodes
in the end the result path is calculated from the learned policy