Giter Club home page Giter Club logo

pydatalondon2016's Introduction

Building a Pong playing AI

This repository contains the resources needed for the tutorial, Building a Pong playing AI in just 1 hour(Plus 4 days training time). The full video for the tutorial is on youtube here.

Installation Guide for OS X

Tested on a Macbook Pro (late 2013) with El Capitan, unsure if GPU-support works.

Requirements:

Install some image libraries and a X framework for MacOS:

brew install sdl_image
brew install Caskroom/cask/xquartz

Clone the repo:

git clone [email protected]:DanielSlater/PyDataLondon2016.git
cd PyDataLondon2016/

Create a virtual environment for Python 2:

conda create --name pong-ai-27 python=2
source activate pong-ai-27

Install listed dependencies plus opencv:

conda install matplotlib numpy opencv

Install tensorflow and pygame:

conda install -c https://conda.anaconda.org/jjhelmus tensorflow
conda install -c https://conda.binstar.org/quasiben pygame

Initialize submodules:

git submodule init
git submodule update

Symlink resources and common in folder examples:

cd examples/
ln -s ../resources/ 
ln -s ../common/ 

Run an example:

python 1_random_half_pong_player.py

Linux Nvidea GPU installation Guide

Tensorflow requires an NVidia GPU and only runs on Linux/Mac so if you don't have these Theano is an option (see below). The examples are all in Tensorflow, but that translates very easily to Theano and we have an example Q-learning Theano implementation that can be extended to work with Pong.

Windows/non nvidia gpu

Either 2 or 3 is fine.
Download which ever version matches the version of Python you plan on using.
Match version

Download anaconda and install packages:

conda install mingw libpython numpy

Clone Theano repo:

git clone https://github.com/Theano/Theano.git

Install theano package:

cd Theano
python setup.py develop

###Docker environment alternative

Docker build

Have a look at the Makefile, essentially this helps you setup an xquartz environment exposed to a docker container along with the required dependencies.
'make all' should in theory launch you into an environment capable of running th examples straight away.

Resources

Used for running reinforcement learning agents against PyGame

PyGame implementation of pong

Even pong can be hard if you're just a machine. Half pong is a simplified version of pong, if you can believe it. The score and other bits of noise are removed from the game. There is only 1 bar and it is only 80x80 pixels which speeds up training and removes the need to downsize the screen

Examples

pydatalondon2016's People

Contributors

danielslater avatar hgrif avatar lyrvid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pydatalondon2016's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.