This is the first project from the Deep Reinforcement Learning Nanodegree, where we have to create a Deep Q-Network and teach it to navigate (and collect bananas) in a large square world.
A reward of +1 is provided for collecting a yellow banana, and a reward of -1 is provided for collecting a blue banana. Thus, the goal is to collect as many yellow bananas as possible while avoiding the blue ones.
The task is episodic, and the goal is to achieve an accumulated reward of, at least, +13 over 100 episodes.
This code was developed on a conda environment
with Python 3.6. You are encouraged to use a virtual environment as well (conda, virtualenv preferably). You can install all the packages on the requirements.txt
.
To replicate our environment, you can run the following command:
conda create --name <env> python=3.6 --file requirements.txt
You can download the environment on one of the links below:
Then you should unzip the file (you'll need to provide the path of this environment to run it on the code).
You can navigate through the Navigation.ipynb
file to explore the Unity Environment and how to run an random-action agent on this task.
Train the model is as easy as running the file train_dqn.py
passing the necessary parameters (the hyperparameters). You can also check the notebook dqn_navigation.ipynb
to a more detailed version on how the model was implemented.
Running a trained model is as simple as calling run_dqn.py
with the path of the trained model as a parameter.
For more information on how the DQN is trained, and which techniques are used, you should checkout this repository's Wiki.