/Udacity-DRL-nanodegree-project1-Navigation

My code and report of Udacity DRL nanodegree project1 Navigation

Primary LanguageJupyter Notebook

Udacity Deep Reinforcement Learning Nanodegree Project 1: Navigation

This repository contains my codes, report and other files for Udacity Deep Reinforcement Learning Nanodegree Project 1: Navigation.

Goal of the project

In this Navigation project, the goal is to train an agent to navigate in a virtual world and collect as many yellow bananas as possible while avoiding blue bananas.

bananas

Environment details

The environment is based on Unity ML-agents. Unity ML-Agents is an open-source Unity plugin that enables games and simulations to serve as environments for training intelligent agents.

Note: The Unity ML-Agent team frequently releases updated versions of their environment. We are using the v0.4 interface. The project environment provided by Udacity is similar to, but not identical to the Banana Collector environment on the Unity ML-Agents GitHub page.

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 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.

Getting started

Installation requirements

  • To begin with, you need to configure a Python 3.6 / PyTorch 0.4.0 environment with the requirements described in Udacity repository

  • Then you need to clone this project and have it accessible in your Python environment

  • For this project, you will not need to install Unity. This is because we have already built the environment for you, and you can download it from one of the links below. You need to only select the environment that matches your operating system:

    (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.

  • Finally, you can unzip the environment archive in the project's environment directory and set the path to the UnityEnvironment in the code.

Instructions

Training an agent

You can either run Navigation.ipynb in the Udacity Online Workspace for "Project1: Navigation" step by step or build your own local environment and set the path to the UnityEnvironment in the code.

Note: The Workspace does not allow you to see the simulator of the environment; so, if you want to watch the agent while it is training, you should train locally.