/quadcopter-project

Use reinforcement learning to teach a quadcopter how to fly

Primary LanguageJupyter NotebookOtherNOASSERTION

Deep Reinforcement Learning Project

Deep Reinforcement Learning Project developed for Udacity's Deep Learning Nanodegree. The goal for this project was to use deep reinforcement learning to teach a quadcopter how to fly. The algorithm used for learning was Deep Deterministic Policy Gradients (DDPG) as described in the Continuous control with deep reinforcement learning paper.

Quadcopter

Getting Started

Clone the repository:

git clone https://github.com/craig-martinson/quadcopter-project.git
cd quadcopter-project

Create a Conda GPU environment:

conda create -n quadcopter python=3.6 matplotlib numpy pandas jupyter keras-gpu imageio
conda activate quadcopter

or a Conda CPU environment:

conda create -n quadcopter python=3.6 matplotlib numpy pandas jupyter keras imageio
conda activate quadcopter

Create an IPython kernel for the quadcopter environment:

python -m ipykernel install --user --name quadcopter --display-name "quadcopter"

Open the Jupyter notebook for the project:

 jupyter notebook Quadcopter_Project.ipynb

Before running code, change the kernel to match the quadcopter environment by using the drop-down menu (Kernel > Change kernel > quadcopter)

Tools

Visualisation of agent learning can be done using visualise.py:

python visualise.py --help
usage: visualise.py [-h] [--save] [num_episodes]

positional arguments:
  num_episodes  Number of episodes to render

optional arguments:
  -h, --help    show this help message and exit
  --save        Write animation to disk instead of displaying

For example the following will generate movie.gif containing the top five training episodes in the root of the repository:

python visualise.py 5 --save

References

The following resources were used in developing this project: