https://github.com/omaraflak/reinforcement-learning-cpp
Reinforcement Learning algorithm from scratch in C++.
https://github.com/omaraflak/reinforcement-learning-cpp
cpp from-scratch neural-network qlearning reinforcement-learning
Last synced: 6 months ago
JSON representation
Reinforcement Learning algorithm from scratch in C++.
- Host: GitHub
- URL: https://github.com/omaraflak/reinforcement-learning-cpp
- Owner: omaraflak
- Created: 2018-07-19T11:18:53.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-19T11:29:00.000Z (about 7 years ago)
- Last Synced: 2025-03-26T08:51:36.646Z (7 months ago)
- Topics: cpp, from-scratch, neural-network, qlearning, reinforcement-learning
- Language: C++
- Size: 6.84 KB
- Stars: 14
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reinforcement Learning
This code demonstrates how to make a reinforcement learning algorithm from scratch in C++.
# Download, Compile & Run
```
git clone https://github.com/OmarAflak/Reinforcement-Learning-CPP
cd Reinforcement-Learning-CPP
make
./main
```
# EnvironmentThe agent has to go from point A to point B.
A..........B
He has two available commands : `left` and `righ`.The reward policy is the following :
* if (agent reaches point **B**) { reward=1 }
* else { reward=0 }# Network
Although the problem is very simple, I used a Neural Network to approach the **Q(s,a)** function.
The network takes the current state of the game as an input, and it outputs the **Q-value** for each possible action.