We train an agent
to navigate in a large square shaped space and collect yellow bananas while avoiding blue bananas. The agent interacts and receives feedback from (Unity ML Agent) envionment using Python API.
The state space
is 37 dimensional space and contains the agent's velocity, along with ray-based perception of objects around agent's forward direction. The agent has to learn which one of the following four actions
to take in any given state:
0
- move forward.1
- move backward.2
- turn left.3
- turn right.
The task is episodic and the environment is considered solved when the agent manages to score of +13 on average over 100 consecutive episodes.
Read more about training process and results in the report. 🐒
To run the code, you need Python 3.6 environment with required dependencies installed.
- Create environment
conda create --name bananaproject python=3.6
source activate bananaproject
- Clone this repository and install requirements
git clone https://github.com/tomkommando/BananaProject.git
cd BananaProject
pip install -r requirements.txt
-
You may need to download a Udacity Banana Project environment. Pick a version that match 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.
(For AWS) If you'd like to train the agent on AWS (and have not enabled a virtual screen), then please use this link to obtain the environment.
-
Place the file in the BananaProject GitHub repository folder, and unzip (or decompress) the file.
In order to run the code:
- Activate environment:
source activate bananaproject
- Make sure you are in the correct folder.
cd BananaProject
- start jupyter notebook server
jupyter notebook
-
Open your browser and connect to the Jupyter Notebook server in the local host address: http://127.0.0.1:8888/. You may need to enter Token which is printed out in the console when you start the Jupyter Notebook server, alternatively you can choose a password for yourself.
-
Run
train_agent.ipynb
and follow the instructions in the file to train an agent or watch a trained agent playing!