4
$\begingroup$

I'm doing a little tic-tac-toe project to learn neural networks and machine learning (beginner level). I've written a MLP based program that plays with other search based programs and trains with the data generated from the games.

The training and evaluation are strictly policy based - Inputs are board positions and outputs are one-hot encoded array that represents the recommended move for that board position. I've not added search algorithms so that I can understand what to expect from a purely MLP approach.

The MLP model has 35 features and 1 hidden layer and after a few hundred thousands games it has sort of learned to draw 50% games. It has learned the basic stuff like how to block the player from winning and some good board placements.

Now, my question is - It hasn't learned advanced strategies that require making a move that may not be as beneficial for the current move but will improve its chances later. But should I expect that from a strictly policy MLP based no-search approach? Since all that it is being trained on is one board and the next recommended move (even if thousands of those pairs), is it logical to expect it to learn a lookahead approach that goes beyond "the best move for the current board" training?

Put another way, would it be a possible at all for a MLP to learn lookahead without any search strategies? If not, are there any alternatives that can do it without search?

$\endgroup$
  • $\begingroup$ What are those 35 features? And where do you get the recommended move from? $\endgroup$ – BlindKungFuMaster Feb 28 '17 at 8:11
  • $\begingroup$ 35 is the number of neurons in the hidden layer (or feature maps in the convolution version). The recommended moves are the moves made by the winners of games in the training data. The idea being that it tries to figure out what the winner of the games did and extracts patterns and strategies by itself. $\endgroup$ – Achilles Feb 28 '17 at 8:20
  • $\begingroup$ But we are talking about tictactoe: 3x3 board and 0 and X moves? $\endgroup$ – BlindKungFuMaster Feb 28 '17 at 8:23
  • $\begingroup$ Yes, that's the one. It's an overkill but I'm using it to understand how neural networks work. $\endgroup$ – Achilles Feb 28 '17 at 8:25
  • $\begingroup$ You should probably avoid spatial pooling if you use a convnet, because it might throw away the exact position of the Xs and 0s. Also, if your maps are 3x3, that's already the full board, they'll have to be smaller. $\endgroup$ – BlindKungFuMaster Feb 28 '17 at 8:36
3
$\begingroup$

A MLP only does pattern recognition, it will not learn search.

Tictactoe, (Oughts and Crosses), is such a simple game that your network should learn the moves from the training data by heart, no generalisation required. If it still loses games, maybe your training data doesn't consist of particularly good moves.

$\endgroup$
  • $\begingroup$ Thanks. Would be able to extract good moves out of a mix (let's say training data generated from a random player) if the training data consists of hundreds of thousands moves consisting of both good and bad moves? $\endgroup$ – Achilles Feb 28 '17 at 8:24
  • $\begingroup$ It should learn the board positions by heart and learn a probability distribution over the moves made in that position, with the highest probability for the most common move. $\endgroup$ – BlindKungFuMaster Feb 28 '17 at 8:27
  • $\begingroup$ So, if you only learn the moves of the winner, that might be enough to extract good moves, if you learn all moves, it will only learn random moves. $\endgroup$ – BlindKungFuMaster Feb 28 '17 at 8:31
  • $\begingroup$ Ok, so if it consistently sees bad moves, it'll learn bad moves, makes sense. I've been looking for emergent phenomenon where it learns human like strategies while playing with random players. $\endgroup$ – Achilles Feb 28 '17 at 8:35
  • $\begingroup$ I feed in only the winner's moves for training but the winner could be winning by fluke even after making bad moves, that explains it. How does it work in games like chess etc where people say that the AI is coming up with its own strategies and what not? $\endgroup$ – Achilles Feb 28 '17 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.