In this project, you’ll implement a Neural Network for Deep Reinforcement Learning and see it learn more and more as it finally becomes good enough to beat the computer in Atari 2600 game Pong! You can play around with other such Atari games at the OpenAI Gym.
By executing this project, you’ll be able to do the following:
- Write a Neural Network from scratch.
- Implement a Policy Gradient with Deep Reinforcement Learning.
- Build an AI for Pong that can beat the computer in less than 250 lines of Python.
- Use OpenAI Gym.
Basically, the code and the idea are all based on Dr. Andrej Karpathy’s blog post on Deep Reinforcement Learning. The CNN code is written in keras. The code in atari_pong_agent.py
is intended to be a simpler version of pong.py
, which was written by Dr. Karpathy.
You’ll need to know the following:
- Basic Python
- Neural Network design and backpropogation
- Calculus and Linear Algebra
Read the blog post on which all of this project is based, if you want a deeper dive into the project.
This project uses the following software and Python libraries:
-
Follow the instructions for installing OpenAI Gym. This requires installing several more involved dependencies, including
cmake
and a recentpip
version. -
Run
pip install -e .[atari]
-
Clone the repository and navigate to the downloaded folder.
git clone https://github.com/adityasaxena26/Atari-Pong-Agent-using-OpenAI-Gym.git
cd Atari-Pong-Agent-using-OpenAI-Gym
- Run
python atari_pong_agent.py