GithubHelp home page GithubHelp logo

alphafour's Introduction

AlphaFour

Scripts and notebooks for playing, simulating, and building AIs for the game ConnectFour

There are two main components to this repository:

  • The four.py script, which allows you to play ConnectFour, as well as simulate games and process data
  • The training.ipynb, which generates ConnectFour "AI" models using TensorFlow

Four.py

four.py is a command-line script that provides the following capabilities:

This repository is designed to support the following steps

  • play: Play a game of ConnectFour again an existing AI
  • simulate: Simulate a game between AIs and save it as data
  • visualize: Visualize a saved game
  • process: Process a saved game into a data format suitable for model training

Training.ipynb

An jupyter notebook that reads in the processed form of games simulated using four.py, trains tensorflow models on them, and serializes the models out. A serialized tensforflow AI can then be used to play games or simulate new games using four.py

Typical Workflows:

Simulate games and process them into training data using as "RANDOM" AI

python four.py simulate --num-games 500000 --output-prefix simulations/random-`date '+%Y-%m-%d-%H:%M:%S'`/
python four.py process --output-prefix training_data/random-2017-10-21-13:41:47/ "simulations/random-2017-10-28-17:13:04/*.json"

Simulate games and process them into training data using an AI built with Tensorflow

python four.py simulate --num-games 100000 --red-model gen1-cov2d_beta_2017_10_29_150829 --yellow-model gen1-cov2d_beta_2017_10_29_150829 --output-prefix simulations/gen1-cov2d_beta_2017_10_29_150829-`date '+%Y-%m-%d-%H:%M:%S'`/
python four.py process --output-prefix training_data/gen-1-cov2d_beta_2017_10_22_142925/ "simulations/gen-1-cov2d_beta_2017_10_22_142925/*.json"

Play against our built and serialized AI model

python four.py play --ai gen2-cov2d_beta_2017_11_05_114919 --player-first false

alphafour's People

Contributors

ghl3 avatar

Watchers

 avatar  avatar

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.