This is the second project of deep reinforcement learning nanodegree of Udacity
python 3.6
pytorch 0.4.1
from unityagents import UnityEnvironment
Before running the code, change the file_name parameter to match the location of the Unity environment that you downloaded.
Mac: "path/to/Reacher20.app"
Windows (x86): "path/to/Reacher_Windows_x86/Reacher20.exe"
Windows (x86_64): "path/to/Reacher_Windows_x86_64/Reacher20.exe"
Linux (x86): "path/to/Reacher_Linux/Reacher20.x86"
Linux (x86_64): "path/to/Reacher_Linux/Reacher20.x86_64"
Linux (x86, headless): "path/to/Reacher_Linux_NoVis/Reacher20.x86"
Linux (x86_64, headless): "path/to/Reacher_Linux_NoVis/Reacher20.x86_64"
For instance, if you are using a Mac, then you downloaded Reacher.app. If this file is in the same folder as the notebook, then the line below should appear as follows:
Single arm version:
env = UnityEnvironment(file_name="Reacher.app")
Twenty arms version:
env = UnityEnvironment(file_name="Reacher20.app")
In this environment, a double-jointed arm(20 arms in second version) 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.
To Solve this environment, your agent must get an average score of +30 over 100 consecutive episode
python train_reacher.py
python infer_reacher.py
The code of the agent is in agent_single_arm.py, the pytorch model is in model_reacher.py
The plot of trainig scores is in ./pictures/reacher.png
The trained model for this environment is ./ckpt/checkpoint1.pth