Body: <p>I've been experimenting with a simple tic-tac-toe game to learn neural network programming (MLP and CNNs) with good results. I train the networks on board positions and the best moves and the network is able to learn and correctly predict the best moves to make when it encounters those board positions.</p>
  <p>But the network is unable to &quot;discover&quot; newer patterns/features from existing ones. For example -</p>
  <p>Let's say that the board position is below and the move is for the X player (AI)</p>
  <pre><code>O  _  _
  
  _  O  _
  
  _  _  _
  </code></pre>
  <p>The recommended move would be 8 (0 based indices) so that the opponent doesn't win, the resulting board would be -</p>
  <pre><code>O  _  _
  
  _  O  _
  
  _  _  X
  </code></pre>
  <p>If I train the network on the above enough times, the AI (MLP or CNN based) learns to play 8 when it encounters the above situation.</p>
  <p>But it doesn't recognize the below as variations (rotated and shifted, respectively but slanted straight lines in general) of the same pattern and is not able to correctly pick 6 and 0, respectively -</p>
  <pre><code>_  _  O            _  _  _
  
  _  O  _     or     _  O  _   etc
  
  _  _  _            _  _  O
  </code></pre>
  <p>My question is - Should I expect CNNs to be able to discover new previously untrained patterns/features such as above?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-05T20:42:22.190Z
Comments.Text: How do you train the NNs?
Comments.UserDisplayName: comodoro
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-05T20:47:09.570Z
Comments.Text: In this case, training is done on board states as inputs and the best moves (as 9x1 one-hot encoded matrix) for those board states as outputs
Comments.UserDisplayName: Achilles
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-05T21:03:14.850Z
Comments.Text: And then tf.reduce_mean on tf.nn.softmax_cross_entropy_with_logits optimized with Adam. Works great with known board states, not so much on similar but not-trained on ones.
Comments.UserDisplayName: Achilles
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-05T21:28:10.550Z
Comments.Text: Not being an expert, just my 2 cents. It should be possible if you gave the NN enough patterns, for it lo learn the few missing ones. A suitable CNN should be better because of the board being 2D.
Comments.UserDisplayName: comodoro
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-06T02:04:27.750Z
Comments.Text: I've run it through hundreds of thousands (different combinations of layers and depth etc) but it never seems to be able to learn the missing ones so far. I'm beginning to suspect that this problem, counterintuitively, is too simple for it to be able to solve but I'm curious if it has worked for someone.
Comments.UserDisplayName: Achilles
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-06T13:12:13.973Z
Comments.Text: You may have to increase the training set/test set ratio (if I have guessed correctly what you are trying to do - train the network on existing patterns and expect some new patterns to be learned). I have no idea if a classical MLP is able to do this, but a CNN should (though CNN is a general term), because you basically have image pattern recognition task. I do not think there is such thing as problem too simple to be solved.
Comments.UserDisplayName: comodoro
Tags: <neural-networks><convolutional-neural-networks><comparison>
Title: Can a CNN or MLP discover similar but untrained-on patterns?
UserDisplayName: Achilles
ThreadText: # Can a CNN or MLP discover similar but untrained-on patterns?
  
  (Asked by: username_0 on 2017-03-03)
  
  I've been experimenting with a simple tic-tac-toe game to learn neural network programming (MLP and CNNs) with good results. I train the networks on board positions and the best moves and the network is able to learn and correctly predict the best moves to make when it encounters those board positions.
  
  But the network is unable to "discover" newer patterns/features from existing ones. For example -
  
  Let's say that the board position is below and the move is for the X player (AI)
  
  ```
  O  _  _
  
  _  O  _
  
  _  _  _
  
  ```
  
  The recommended move would be 8 (0 based indices) so that the opponent doesn't win, the resulting board would be -
  
  ```
  O  _  _
  
  _  O  _
  
  _  _  X
  
  ```
  
  If I train the network on the above enough times, the AI (MLP or CNN based) learns to play 8 when it encounters the above situation.
  
  But it doesn't recognize the below as variations (rotated and shifted, respectively but slanted straight lines in general) of the same pattern and is not able to correctly pick 6 and 0, respectively -
  
  ```
  _  _  O            _  _  _
  
  _  O  _     or     _  O  _   etc
  
  _  _  _            _  _  O
  
  ```
  
  My question is - Should I expect CNNs to be able to discover new previously untrained patterns/features such as above?
  
  **Tags:** neural-networks, convolutional-neural-networks, comparison
  
  > **Comments:**
  > **username_1**: How do you train the NNs?  
  > **username_0**: In this case, training is done on board states as inputs and the best moves (as 9x1 one-hot encoded matrix) for those board states as outputs  
  > **username_0**: And then tf.reduce_mean on tf.nn.softmax_cross_entropy_with_logits optimized with Adam. Works great with known board states, not so much on similar but not-trained on ones.  
  > **username_1**: Not being an expert, just my 2 cents. It should be possible if you gave the NN enough patterns, for it lo learn the few missing ones. A suitable CNN should be better because of the board being 2D.  
  > **username_0**: I've run it through hundreds of thousands (different combinations of layers and depth etc) but it never seems to be able to learn the missing ones so far. I'm beginning to suspect that this problem, counterintuitively, is too simple for it to be able to solve but I'm curious if it has worked for someone.  
  > **username_1**: You may have to increase the training set/test set ratio (if I have guessed correctly what you are trying to do - train the network on existing patterns and expect some new patterns to be learned). I have no idea if a classical MLP is able to do this, but a CNN should (though CNN is a general term), because you basically have image pattern recognition task. I do not think there is such thing as problem too simple to be solved.  
  
  ---
  
  ## 0 answers
  
  