An open API service indexing awesome lists of open source software.

https://github.com/daugaard/q-learning-simple-game


https://github.com/daugaard/q-learning-simple-game

ai ml q-learning reinforcement-learning ruby rubyml

Last synced: 9 days ago
JSON representation

Awesome Lists containing this project

README

          

# 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](http://www.practicalai.io/teaching-ai-play-simple-game-using-q-learning/).