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.
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.
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.
The task is episodic, and in order to solve the environment, your agent must get an average score of +30 over 100 consecutive episodes.
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 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
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:
- Linux: click here
- Mac OSX: click here
- Windows (32-bit): click here
- Windows (64-bit): click here
- Linux: click here
- Mac OSX: click here
- Windows (32-bit): click here
- Windows (64-bit): click here
Then, unzip (or decompress) the file to the repo's root directory.
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.
- Udacity Deep Reinforcement Learning course and repo
- Continuous control with deep reinforcement learning