Deep-Policy-Gradient
Deep-Policy-Gradient copied to clipboard
Use basic deep reinforcement learning to solve Doom health gathering environment
Deep Policy Gradient Reinforcement Learning
This repository has the code from my O'Reilly article 'Reinforcement Learning w/ TensorFlow' published on.
This code contains tools for implementing the reinforcement learning algorthing REINFORCE w/ baselines using TensorFlow and a convolutional Neural Network
Required Packages
There are two ways you can install these packages: by using Docker or by using native Python 3.5. If you use Docker you will not be able to render the environment.
Using Docker
-
Download and install Docker. If using Ubuntu 14.04/16.04 I wrote my own instructions for installing docker here.
-
Download and unzip this entire repo from GitHub, either interactively, or by entering
git clone https://github.com/wagonhelm/Deep-Policy-Gradient.git -
Open your terminal and use
cdto navigate into the directory of the repo on your machinecd Deep-Policy-Gradient -
To build the Dockerfile, enter
docker build -t dpg_dockerfile -f dockerfile .If you get a permissions error on running this command, you may need to run it with
sudo:sudo docker build -t dpg_dockerfile -f dockerfile . -
Run Docker from the Dockerfile you've just built
docker run -it -p 8888:8888 -p 6006:6006 dpg_dockerfile bashor
sudo docker run -it -p 8888:8888 -p 6006:6006 dpg_dockerfile bashif you run into permission problems.
-
Launch Jupyter and Tensorboard both by using tmux
tmux jupyter notebook --allow-rootPress CTL+BthenCto open a new tmux window, thentensorboard --logdir='/tmp/dpg'To switch windows
Press CTL+Bthenwindow #Once both jupyter and tensorboard are running, using your browser, navigate to the URLs shown in the terminal output if those don't work try http://localhost:8888/ for Jupyter Notebook and http://localhost:6006/ for Tensorboard.
Using Native Python 3
- Install system requirements
sudo apt-get install git cmake zlib1g-delibjpeg-dev libboost-all-dev libsdl2-dev wget unzip gitboostbuild-essential zlib1g-dev libsdl2-dev libjpeg-dev nasm tar libbz2-dev libgtk2.0-dev cmake libfluidsynth-dev libgme-dev libopenal-dev timidity libwildmidi-dev python3-pip python3-dev python3-wheel
- Download and unzip this entire repo from GitHub, either interactively, or by entering
git clone https://github.com/wagonhelm/Deep-Policy-Gradient.git
- Install Python Requirement
cd Deep-Policy-Gradient
pip3 install -r requirements.txt
pip3 install tensorflow jupyter
- Launch Jupyter
jupyter notebook
- Launch Tensorboard
tensorboard --logdir='/tmp/dpg'
Once both jupyter and tensorboard are running, using your browser, navigate to the URLs shown in the terminal output if those don't work try http://localhost:8888/ for Jupyter Notebook and http://localhost:6006/ for Tensorboard.