Training an agent to play game using reinforcement learning
Environment: Navigation (Modified Unity Environment).Here we will train an agent to collect yellow bananas while avoiding blue bananas.
Number of state space: The state space has 37 dimensions and contains the agent's velocity, along with ray-based perception of objects around the agent's forward direction. Given this information, the agent has to learn how to best select actions.
Number of action space: Four discrete actions are available (right,left,forward,backward)
The task is episodic, and in order to solve the environment, your agent must get an average score of +13 over 100 consecutive episodes.
To set up your python environment to run the code in this repository, follow the instructions below.
-
Create (and activate) a new environment with Python 3.6.
- Linux or Mac:
conda create --name game python=3.6 source activate game
- Windows:
conda create --name game python=3.6 activate game
-
Follow the instructions in this repository to perform a minimal install of OpenAI gym.
-
Clone the repository (if you haven't already!), and navigate to the
python/
folder. Then, install several dependencies.
git clone https://github.com/abhismatrix1/navigation.git
cd navigation/python
pip install .
-
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.
(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 navigation GitHub repository, at root, and unzip (or decompress) the file.
-
Create an IPython kernel for the
game
environment.
python -m ipykernel install --user --name game --display-name "game"
- Before running code in a notebook, change the kernel to match the
game
environment by using the drop-downKernel
menu.
Follow the instructions in Navigation.ipynb
to get started with training your own agent!