dpoulopoulos / drl_navigation

A Deep Q-Learning agent that utilizes its acquired skills to navigate in a large, square example world.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unity-Technologies Navigation Project

Unity Machine Learning Agents (ML-Agents) is an open-source Unity plugin that enables games and simulations to serve as environments for training intelligent agents.

For game developers, these trained agents can be used for multiple purposes, including controlling NPC behaviour (in a variety of settings such as multi-agent and adversarial), automated testing of game builds and evaluating different game design decisions pre-release.

In this project, we develop a Deep Q-Learning agent that utilises its newly acquired skills to navigate in a large, square example world and collect bananas. 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 the 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:

  • move forward
  • move backwards
  • turn left
  • 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.

Dependencies

To set up your python environment to run the code in this repository, follow the instructions below.

  1. Create (and activate) a new environment with Python 3.6.

    • Linux or Mac:
    conda create --name navigation python=3.6
    source activate navigation
    • Windows:
    conda create --name navigation python=3.6
    activate navigation
  2. Install Dependencies

    • Install Pytoch by following the instructions for your system here

    • To install the necessary dependencies run pip install ./python

  3. Download the Unity 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 only select the environment that matches your operating system:

  1. Create an IPython kernel for the navigation environment.
python -m ipykernel install --user --name navigation--display-name "navigation"
  1. Before running code in a notebook, change the kernel to match the navigation environment by using the drop-down Kernel menu.

Usage

Open the Navigation.ipynb on a notebook and run the cells. In any case, the weights of a pretrained network are saved in checkpoint.pth, so you can witness how a trained agent behaves.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

A Deep Q-Learning agent that utilizes its acquired skills to navigate in a large, square example world.


Languages

Language:ASP 58.0%Language:Python 31.4%Language:Jupyter Notebook 10.6%