Skip to content

Teuling/Reacher

Repository files navigation

Reacher

This repository contains code to train a neural net using the actor-critic method to solve unity reacher challenge.

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.

reacher

There are two versions of this environment.

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

The code in this repo makes use of the version with 20 identical agents.

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

The problem is considered solved if an average score of +30 (over 100 consecutive episodes, and over all agents) is achieved.

Installation

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 drlnd python=3.6
    source activate drlnd
    • Windows:
    conda create --name drlnd python=3.6 
    activate drlnd
  2. If running in Windows, ensure you have the "Build Tools for Visual Studio 2019" installed from this site. This article may also be very helpful. This was confirmed to work in Windows 10 Home.

  3. Clone the repository (if you haven't already!), and navigate to the python/ folder. Then, install several dependencies.

    git clone https://github.com/Teuling/Reacher.git
    cd Reacher
    cd python
    pip install .
    if torch 0.4.0 is not found then 'pip install http://download.pytorch.org/whl/cpu/torch-0.4.0-cp36-cp36m-win_amd64.whl' and retry
  4. Create an IPython kernel for the drlnd environment.

    python -m ipykernel install --user --name drlnd --display-name "drlnd"
  5. Before running code in a notebook, change the kernel to match the drlnd environment by using the drop-down Kernel menu.

Running the code

Open ReacherControl.ipynb in vcode or jupyter notebook and execute the code cells.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published