Skip to content

Deep reinforcement Learning Nanodegree - Navigation Project

Notifications You must be signed in to change notification settings

KalyanKumarPichuka/drlnd_navigation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trained agent

Introduction

This project uses a Deep Q Network (DQN) to train an agent to navigate a 3D environment, specifically a variant of the Banana Collector environment. This project is being done as part of the Udacity Deep Reinforcement Learning Nanodegree, a four month course that I am taking.

Environment Description

This environment is a simplified version of the ML Agents example one. It has a single agent, a smaller state space and a discrete action space. The environment is a open 3D space that the agent will need to navigate. The goal is to collect as many good (yellow) bananas as possible while avoiding bad (blue) ones. A reward of +1 is provided for collecting a yellow banana, and a reward of -1 is provided for collecting a blue banana.

The state space has 37 dimensions and contains the agent's velocity, along with ray-based perception of objects around the 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, the agent must get an average score of +13 over 100 consecutive episodes.

Installation

Pre-requisites

  • Make sure you having a working version of Anaconda on your system.

Step 1: Clone the repo

Clone this repo using https://github.com/kalyan369/drlnd_navigation.git.

Step 2: Install Dependencies

Create an anaconda environment that contains all the required dependencies to run the project.

Mac:

conda create --name drlnd_navigation python=3.6
source activate drlnd_navigation
conda install -y python.app
conda install -y pytorch -c pytorch
pip install torchsummary unityagents

Windows:

conda create --name drlnd_navigation python=3.6
activate drlnd_navigation
conda install -y pytorch -c pytorch
pip install torchsummary unityagents

Step 3: Download Banana environment

You will also need to install the pre-built Unity environment, you will NOT need to install Unity itself. Select the appropriate file for your operating system:

  • Linux: click here
  • Mac OSX: click here
  • Windows (32-bit): click here
  • Windows (64-bit): click here

Download the file into the top level directory of this repo and unzip it.

Train your agent

To train the agent run python training.py. This will start the Unity environment and output live training statistics to the command line opened. Trained model is saved in checkpoints/solved.pth. some graphs that help visualize the agent's learning progress are stored in results folder. It should take the agent around 150 - 250 episodes to solve the environment.

To watch your trained agent interact with the environment run python training.py --render. This will load the saved weights from a checkpoint file. A previously trained model is included in this repo.

Report

See the report for more insight on how current hyperparameters are arrived at.