Skip to content

Machine Learning tic tac toe using linear neural network model.

License

Notifications You must be signed in to change notification settings

customjack/MLtictactoe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

MLtictactoe

Machine Learning tic tac toe using linear neural network model.

REQUIRED PACKAGES:

  • numpy

  • tensorflow (can be downloaded with by downloading keras)

  • keras

  • matplotlib

You can train a model that can be used by a bot to choose moves with trainModel.py. The game can be an arbitrary number of rows and columns, configurable by changing N_ROWS and N_COLS. N_GAMES is the number of games two bots will play (with each move decided randomly) to generate training data for the keras model. After training, the model will automatically be saved as 'tictactoe_{N_ROWS}x{N_COLS}.model'

You can play a bot that uses the trained model to decide it's moves by running tictactoePlayGame.py. You can change which bot you are playing by editting BOT_MODEL_NAME.

tictactoe.py contains a class that handles the tic tac toe game and stores game data.

MLbot.py contains the code the bot uses to decide it's moves.

About

Machine Learning tic tac toe using linear neural network model.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages