Solved – How to train a neural network when inputs are not the same size

deep learningmachine learningneural networks

Say I'm looking to train a neural network to decide the winner of a tic-tac-toe game (contrived example I realize). The problem is that the number of moves in a given game isn't always the same. Therefore, my inputs will be of varying lengths. Are there any strategies for training a NN that do not involve "normalizing" my inputs so they're all the same lengths?

I've found 3 other posts (1, 2, 3) with essentially this same question, but they all boil down to normalizing the data into equal lengths. Are there any other strategies? Or are there any other techniques instead of NNs that can handle varying input sizes?

Best Answer

To your second question, the field of machine learning you may want to look into is called reinforcement learning. Very briefly, reinforcement learning concerns problems of how an agent (player) should act (select squares) in an environment (tic-tac-toe board) given some formalized notion of reward (a 0-1 loss-win function, e.g.).

In fact, tic-tac-toe has been used as an example problem in reinforcement learning papers and texts.

Related Question