Skip to content

Training an agent to play game using reinforcement learning

License

Notifications You must be signed in to change notification settings

abhismatrix1/navigation

Repository files navigation

Navigation - Deep reinforcement learning agent

Training an agent to play game using reinforcement learning

Environment (provided by udacity under reinforcement learning nano degree)

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)

When environment is considered to be solved?

The task is episodic, and in order to solve the environment, your agent must get an average score of +13 over 100 consecutive episodes.

Getting Started

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 game python=3.6
    source activate game
    • Windows:
    conda create --name game python=3.6 
    activate game
  2. Follow the instructions in this repository to perform a minimal install of OpenAI gym.

    • Next, install the classic control environment group by following the instructions here.
    • Then, install the box2d environment group by following the instructions here.
  3. 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 .
  1. Download the environment from one of the links below. You need only select the environment that matches your operating system:

    (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.

  2. Place the file in the navigation GitHub repository, at root, and unzip (or decompress) the file.

  3. Create an IPython kernel for the game environment.

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

Instructions

Follow the instructions in Navigation.ipynb to get started with training your own agent!

About

Training an agent to play game using reinforcement learning

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published