Giter Club home page Giter Club logo

tictactoe-ai-bot's Introduction

Tic-Tac-Toe AI bot

A bot for Tic-Tac-Toe that uses deep reinforcement learning trained using keras-rl DQN agent.

All code in main.ipynb

Trained weights are present in dqn_weights.h5f

Additional

  1. A PPO agent built with stable-baselines.

    All code in MlpPolicy.ipynb

    A trained model with PPO1 of stable baselines is in PPO1_model.
    A trained model with PPO2 of stable baselines is in PPO2_model.

  2. A heuristic using bot. A n-step-lookahead bot which uses minimax algorithm to find the optimal move.

    import heuristicBot
    ...
    move = heuristicBot.nslAgent(no_of_step_to_lookahead, game_grid, available_moves_on_grid, player_number)
    ...
    # returns a valid index to where the move should be made
    # PARAMETERS =>
    # no_of_step_to_lookahead = (max 9, min 1)
    # game_grid = a 9x9 2D numpy array with value 0:empty, 1:X, 2:O
    # available_moves_on_grid = list of all empty places on the grid
    # player_number = 1 or 2

Requirements

numpy==1.19.4
gym==0.18.3
stable-baselines==2.10.2
tensorflow==1.15.0
tensorflow-gpu==1.15.0
python==3.7
keras-rl

by Debashish Gogoi

tictactoe-ai-bot's People

Contributors

devzard avatar

Watchers

 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.