daugaard / q-learning-simple-game

Home Page:https://www.practicalai.io/teaching-ai-play-simple-game-using-q-learning/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example of reinforcement learning using q-learning to teach an AI to play a game in Ruby

This example will show how we can teach an AI to play a simple game using the Q-learning reinforcement learning algorithm.

This is implemented in pure Ruby without any external dependencies.

To run the game and play a human run:

$ ruby run.rb

To run the game and let the AI play run:

$ ruby run-q.rb

For more information about how this is implemented see Teaching an AI to play a simple game using q-learning.