Skip to content

Reinforcement Learning Agent that learns how to control multiple robot arms

Notifications You must be signed in to change notification settings

jibin-liu/unity-ml-agent-reacher

Repository files navigation

Continuous Control

This notebook presents the work of training a Reinforcement Learning (RL) agent to control 20 double-jointed arms to reach moving targets, in the Unity ML-Agents environment. The model that based on the Deep Deterministic Policy Gradient(DDPG) algorithm.

Introduction

In this environment, a double-jointed arm can move to target locations. A reward of +0.1 is provided for each step that the agent's hand is in the goal location. Thus, the goal of your agent is to maintain its position at the target location for as many time steps as possible.

The observation space consists of 33 variables corresponding to position, rotation, velocity, and angular velocities of the arm. Each action is a vector with four numbers, corresponding to torque applicable to two joints. Every entry in the action vector should be a number between -1 and 1.

Solving the Environment

For this project, there are two separate versions of the Unity environment:

  • The first version contains a single agent.
  • The second version contains 20 identical agents, each with its own copy of the environment.

Solve the First Version

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

Solve the Second Version

The barrier for solving the second version of the environment is slightly different, to take into account the presence of many agents. In particular, your agents must get an average score of +30 (over 100 consecutive episodes, and over all agents). Specifically,

After each episode, we add up the rewards that each agent received (without discounting), to get a score for each agent. This yields 20 (potentially different) scores. We then take the average of these 20 scores.

This yields an average score for each episode (where the average is over all 20 agents).

Python environment

Python 3.6 is used to conduct the work. However, Python 3.5 should also work.

To prepare the Python environment, first create a virtual environment using your favoured package mangement tool, then cd to the repo's root directory and run the following command:

pip -q install ./python

Download the Unity environment

For this project, you will not need to install Unity - this is because we (Udacity) 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:

Version 1: One (1) Agent

Version 2: Twenty (20) Agents

Then, unzip (or decompress) the file to the repo's root directory.

Train the agent

In Report.ipynb, it details the steps on how to train the agent from scratch. You don't need to have a GPU to train it.

References

About

Reinforcement Learning Agent that learns how to control multiple robot arms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published