https://github.com/aserhiychuk/pyreinforce
Deep Reinforcement Learning library for Python
https://github.com/aserhiychuk/pyreinforce
ai atari machine-learning neural-networks openai-gym python reinforcement-learning tensorflow
Last synced: 7 months ago
JSON representation
Deep Reinforcement Learning library for Python
- Host: GitHub
- URL: https://github.com/aserhiychuk/pyreinforce
- Owner: aserhiychuk
- License: mit
- Created: 2019-05-14T23:25:23.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-06-09T23:25:21.000Z (almost 4 years ago)
- Last Synced: 2025-07-24T04:01:40.835Z (8 months ago)
- Topics: ai, atari, machine-learning, neural-networks, openai-gym, python, reinforcement-learning, tensorflow
- Language: Python
- Homepage:
- Size: 3.76 MB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyReinforce
**PyReinforce** is a collection of algorithms that can be used to solve a variety of different reinforcement learning problems.
| Breakout | Pong | Space Invaders |
|:-:|:-:|:-:|
| [](examples/Atari.ipynb) | [](examples/Atari.ipynb) | [](examples/Atari.ipynb) |
| Cart Pole | Lunar Lander | Pendulum |
|:-:|:-:|:-:|
| [](examples/MonteCarlo.ipynb) | [](examples/TemporalDifference.ipynb) | [](examples/DDPG.ipynb) |
## Basics
This is how [OpenAI Gym](https://gym.openai.com/) describes the reinforcement learning process:
>There are two basic concepts in reinforcement learning: the environment (namely, the outside world) and the agent (namely, >the algorithm you are writing). The agent sends actions to the environment, and the environment replies with observations and >rewards (that is, a score).
PyReinforce is fully compatible with [OpenAI Gym](https://gym.openai.com/). In fact, it will work with **any** environment as long as it implements these methods:
* `reset()`
* `step(action)`
Your part is to implement a `Brain`: a neural network that agents use to decide which actions to pick for given states. Agents get better over time by performing training steps on their brains. See [examples](examples) for more details.
## Installation
Install PyReinforce from PyPI:
```bash
pip install PyReinforce
```
or from source:
```bash
git clone https://github.com/aserhiychuk/pyreinforce.git
cd pyreinforce
pip install -e .
```
## Examples
* [Monte Carlo](examples/MonteCarlo.ipynb)
* [Temporal Difference](examples/TemporalDifference.ipynb)
* [Policy Gradient](examples/PolicyGradient.ipynb)
* [Deep Deterministic Policy Gradient](examples/DDPG.ipynb)
* [Deep Q-Learning](examples/Atari.ipynb)
In order to run the examples you need to install dependencies:
```bash
pip install -r examples/requirements.txt
```