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
- Host: GitHub
- URL: https://github.com/daugaard/q-learning-simple-game
- Owner: daugaard
- Created: 2017-08-13T15:40:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-03T21:18:32.000Z (over 8 years ago)
- Last Synced: 2024-08-04T01:05:26.365Z (over 1 year ago)
- Topics: ai, ml, q-learning, reinforcement-learning, ruby, rubyml
- Language: Ruby
- Homepage: https://www.practicalai.io/teaching-ai-play-simple-game-using-q-learning/
- Size: 13.7 KB
- Stars: 37
- Watchers: 3
- Forks: 17
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- machine-learning-with-ruby - [code
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/).