For this project, you will train an agent to navigate (and collect bananas!) in a large, square world.
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 your 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 agent's forward direction. Given this information, the agent has to learn how to best select actions. Four discrete actions are available, corresponding to:
0
- move forward.1
- move backward.2
- turn left.3
- turn right.
The task is episodic, and in order to solve the environment, your agent must get an average score of +13 over 100 consecutive episodes.
-
Download the environment 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
(For Windows users) Check out this link if you need help with determining if your computer is running a 32-bit version or 64-bit version of the Windows operating system.
-
Place the file in the PROJECT GitHub repository, in the
rainbow_navigation_project/
folder, and unzip (or decompress) the file. -
install environment
- pip install matplotlib
- pip install mlagents
- pip install numpy
- That should be it.
Follow the instructions in rainbow.ipynb
either train or test the solution!
It is also written as python classes if that suits you better, but I will only go into details with the rainbow.ipynb
.
While the results are not optimal, it will solve the problem in around 300 episodes. I have created a better solution for the project that will solve it in less than 160 episodes, but it is not a rainbow implementation. The hyper-parameters for this project needs to be tuned further to improve the max average result over 100 episodes. As the hyper-parameters are set now, it will evens out around an average of 13.
I will recomment reading the report.pdf for better understanding of the rainbow implementation and look through the comments in the code. It should be fairly well commented.
Through this implementation I have seeked guidance through others implementation of the different techniques used rainbow is all you need, and create my own implementation specific to solve the navigation project. To learn the affect of each implementation I found the README from KaplanAlex where good and I learned a lot from his small summary.
I have commented the code well to show understanding of the subject as well as notes to future me.