GithubHelp home page GithubHelp logo

marmelab / connect-four-tensorflow Goto Github PK

View Code? Open in Web Editor NEW
6.0 14.0 6.0 1 MB

Connect four solver using neural networks and tensorflow

Makefile 1.82% Python 98.18%
agile-integration tensor-flow

connect-four-tensorflow's Introduction

onboarding Archived Repository
The code of this repository was written during a Marmelab agile integration. It illustrates the efforts of a new hiree, who had to implement a board game in several languages and platforms as part of his initial learning. Some of these efforts end up in failure, but failure is part of our learning process, so the code remains publicly visible.
This code is not intended to be used in production, and is not maintained.

connect-four-tensorflow

Connect four solver using neural networks and tensorflow

Run

Runs the script

python train.py --p1 <xxx> --p2 <xxx> --board_width <x> --board_height <x> --iterations <x> --randomness <x> -v
  • p1 : which algorithm the first player should use (human, minimax, neural_network)
  • p2 : which algorithm the second player should use (human, minimax, neural_network)
  • board_width : width of the board (default: 4)
  • board_height : height of the board (default: 4)
  • iterations : number of games played (default: 1)
  • randomness : randomness of first player (default: 0.25)
  • v: verbose output

Example :

python train.py --p1 minimax --p2 neural_network --iterations 200000 --randomness 0.1

Test

Runs all the tests of the project

make test

Contribute

Where the things happen :

  • train.py : handles the differnt games and calls the different AIs
  • ai/neural-network/neural-network.py : create the neural network, uses it for prediction and handles back propagation
  • connectfour/game.py : handles connect four game, makes AIs play and check who wins

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.