Mathspy / tic-tac-toe-NN

Simplest form of Feed Forward Neural Network in TensorFlow for playing Tic-Tac-Toe
https://mathspy.github.io/tic-tac-toe-NN/
MIT License
1 stars 0 forks source link

Describe the learning data set #1

Open Zemke opened 4 years ago

Zemke commented 4 years ago

Thanks a lot for this and the thorough description. It's helped understanding some things as I get started with Machine Learning.

What I was wondering about was the pickle files which apparently has 18 elements and I was wondering why that is and what they represent. And same for the test/validation set.

That would help me further understand things. Thanks!

Mathspy commented 4 years ago

Hello @Zemke, thanks for taking interest in this old experiment!

So the reason the input files has 18 elements (as opposed to 9) is because it's impossible to describe a cell in Tic Tac Toe using a single discrete values (0 or 1, a boolean) and it's "unintuitive" to try to use continuous values (0~1). To elaborate on the lack of intuitiveness of continuous method. You could in theory make an empty cell 0 and an X 0.5 and an O 1 but this results in a loss of information and kind of implies the network should act correctly if you give it non-logical input like 0.25 (half empty half X?) So instead we use two discrete values, much like using two bits to represent 3 states (00 is both empty, 01 is O, 10 is X, 11 is an impossible state that doesn't exist in the input data set). Since we need two discrete values for each cell and there are nine cells we end up with 18 inputs!

The way the inputs were generated is by finding all permutations of Empty/X/O across the board then filtering the valid from invalid ones (using the rules of TicTacToe, there can't be two Os on board if there are no Xs etc) They are then ran through a normal TicTacToe MinMaxing algorithm to generate best move

This is a bit of an unconventional use for Neural Networks but there is no test and validation sets as the point of the experiment was to try to "extract the information of the minmaxing algorithm into a pure performant Mathematical function (An NN)" so overfitting is welcome. In fact the goal is to overfit 100% to the learning dataset!

Zemke commented 4 years ago

Okay, thanks a lot!