Skip to content

riley-mld/UnityBanana_DQN

Repository files navigation

Deep Reinforcement Learning Agent for Collecting Bananas

This project was done as part of the _Udacity Deep Reinforcement Learning Nanodegree Deep Q Learning was used in this project to teach an agent to collect yellow bananas and avoid blue bananas in a Unity environment.

Getting Started

For Installing this code, you will need to install the dependencies first or You can also install the folder python in the repo using git for easy installation.

Dependencies

Pytorch, Numpy, Matplotlib, unityagents, Jupyter Notebook

Instructions

For Training the agents after going through the installation steps, first open the Navigation file with Jupyter Notebook. Then change the line with the path to the environment, to where it's located in your computer. You can download the files from here and unzip them at the repositories location.

Place the file in the DRLND GitHub repository, in the p1_navigation/ folder, and unzip (or decompress) the file.

(For Windows users) Check out this link if you need help with determining if your computer is running a 32-bit version or 64-bit version of the Windows operating system.

(For AWS) If you'd like to train the agent on AWS (and have not enabled a virtual screen), then please use this link to obtain the environment.

After this Just run the cells in order in Navigation_NB.ipynb to train your agent.

Project Details

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 of your agent is to collect as many yellow bananas as possible while avoiding blue bananas.

The state space has 37 dimensions and contains the agent's velocity, along with ray-based perception of objects around agent's forward direction. Given this information, the agent has to learn how to best select actions. Four discrete actions are available, corresponding to:

  • 0 - move forward.
  • 1 - move backward.
  • 2 - turn left.
  • 3 - turn right.

The task is episodic, and in order to solve the environment, your agent must get an average score of +13 over 100 consecutive episodes.

Deep Q Learning

For this project I used and experimented with two identical network one as a target one as the network that trains. I Also used techniques such as Double DQN, Dueling DQN and Prioritized Experience Replay. For more information read the report file in the repo This papers were used in creating this project:

License

This project is license under the MIT License. For more info check the license file in the repo.

About

A deep Q model to solve bannana enviroment in Unity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published