Answers.Body: <blockquote>
    <p>I do not want to hand pick the features as I want the network to learn everything by itself. </p>
  </blockquote>
  
  <p>There is an AI-Koan concerning this situation:</p>
  
  <blockquote>
    <p>In the days when Sussman was a novice, Minsky once came to him as he
    sat hacking at the PDP-6. </p>
    
    <p>"What are you doing?", asked Minsky. </p>
    
    <p>"I am training a randomly wired neural net to play Tic-Tac-Toe" Sussman
    replied. </p>
    
    <p>"Why is the net wired randomly?", asked Minsky. </p>
    
    <p>"I do not  want it to have any preconceptions of how to play", Sussman said.</p>
    
    <p>Minsky then shut his eyes. </p>
    
    <p>"Why do you close your eyes?", Sussman asked his teacher. </p>
    
    <p>"So that the room will be empty." </p>
    
    <p>At that moment, Sussman was enlightened.</p>
  </blockquote>
  
  <p>Think about it.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-02-07T08:59:45.073Z
Answers.Text: I really like this answer, although it's probably a comment. Why waste years of knowledge and experience and reinvent the wheel...
Answers.UserDisplayName: Rafiek
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-02-07T12:05:23.780Z
Answers.Text: I think the point is that you have *always* "preconceptions", even if they are "random", even if you decide not to look at them.
Answers.UserDisplayName: Landei
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-02-06T07:36:17.620Z
Answers.LastActivityDate: 2014-02-06T07:36:17.620Z
Answers.UserDisplayName: Landei
Body: <p>I am working on a project where I take a chess board position (FEN string converted to binary) &amp; it's evaluation score and feed it to a neural network. My aim is to make the neural network differentiate between good and bad positions.</p>
  
  <p><strong>How I encode the position :</strong> There are 12 unique pieces in chess i.e pawn, rook, knight, bishop, queen and king for <em>white</em> as well as <em>black</em>. I encode each piece using 4 bits with 0000 denoting an empty square. So the 64 squares are encoded into 256 bits and I use 6 more bits to denote game state like whose turn it is to move, king-castle status, etc.</p>
  
  <p><strong>Problem :</strong> Since the input space for chess positions is neither smooth nor uni-modal (one small change in the board position can result in a huge change in the evaluation score), the neural network doesn't learn well. Now, the next logical thing to somehow extract useful features (like material difference, center control, etc) and feed it to the network.</p>
  
  <p>I do not want to hand pick the features as I want the network to learn everything by itself. Therefore I am thinking of extracting features automatically using <em>autoencoders</em>. Is there any better way to accomplish this?</p>
  
  <p><strong>Summary :</strong> What is the best way to automatically extract features from a chess board position so that it can be fed into a neural network?</p>
  
  <p><strong>UPDATE :</strong> To generate training data, I have modified Stockfish to dump it's evaluation process into a log file. So every new move(position) it considers is written to a file as an FEN string along with it's eval score</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-02-03T21:27:28.430Z
Comments.Text: What are you using for training data? Game results from each given position?
Comments.UserDisplayName: Jacob
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-02-03T21:32:15.807Z
Comments.Text: Does "I do not want to hand pick features" imply that you don't want the method to contain any chess knowledge? If so, I'm not sure chess.SE is the best place to get answers.
Comments.UserDisplayName: JiK
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-02-03T23:25:16.840Z
Comments.Text: If you don't start with known positional features, you will be asking your network to recapitulate centuries of chess theory just to get back to where we are now.  A more fruitful approach (it seems to me) would be to start with every known positional feature and have your network learn which ones are important and in which situations.
Comments.UserDisplayName: Kyle Jones
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-02-04T00:41:29.973Z
Comments.Text: I am not confident that this is a good application for neural networks.
Comments.UserDisplayName: Tony Ennis
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-02-04T00:45:00.993Z
Comments.Text: To be accurate, you'll need more bits, number of moves since the last pawn was moved or piece captured and a bit if a pawn can capture another _en passant_.
Comments.UserDisplayName: Tony Ennis
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-02-04T09:37:59.810Z
Comments.Text: @Jacob I have modified Stockfish to dump it's evaluation process into a log file. So every new move(position) it considers is written to a file as an FEN string along with it's eval score
Comments.UserDisplayName: Rahul
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-02-04T09:41:15.500Z
Comments.Text: @JiK I am open to suggestions. Ideally I would like some feature extraction tool like *autoencoders* to take in raw FEN and come up with important features on it's own. If that seems improbable, then I may have to extract them manually and feed it to the neural network
Comments.UserDisplayName: Rahul
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-02-04T09:44:27.937Z
Comments.Text: @TonyEnnis yes you are right. As of now only *en passant* and *the 50 move rule* are not incorporated. But my guess is that they will not affect the process very much, at least in the initial stages. Once I can get it up and working, I may include them.
Comments.UserDisplayName: Rahul
Tags: <engines><software><training>
Title: How can I automatically extract features from a position?
ThreadText: # How can I automatically extract features from a position?
  
  (Asked by: username_0 on 2014-02-03)
  
  I am working on a project where I take a chess board position (FEN string converted to binary) & it's evaluation score and feed it to a neural network. My aim is to make the neural network differentiate between good and bad positions.
  
  **How I encode the position :** There are 12 unique pieces in chess i.e pawn, rook, knight, bishop, queen and king for *white* as well as *black*. I encode each piece using 4 bits with 0000 denoting an empty square. So the 64 squares are encoded into 256 bits and I use 6 more bits to denote game state like whose turn it is to move, king-castle status, etc.
  
  **Problem :** Since the input space for chess positions is neither smooth nor uni-modal (one small change in the board position can result in a huge change in the evaluation score), the neural network doesn't learn well. Now, the next logical thing to somehow extract useful features (like material difference, center control, etc) and feed it to the network.
  
  I do not want to hand pick the features as I want the network to learn everything by itself. Therefore I am thinking of extracting features automatically using *autoencoders*. Is there any better way to accomplish this?
  
  **Summary :** What is the best way to automatically extract features from a chess board position so that it can be fed into a neural network?
  
  **UPDATE :** To generate training data, I have modified Stockfish to dump it's evaluation process into a log file. So every new move(position) it considers is written to a file as an FEN string along with it's eval score
  
  **Tags:** engines, software, training
  
  > **Comments:**
  > **username_1**: What are you using for training data? Game results from each given position?  
  > **username_2**: Does "I do not want to hand pick features" imply that you don't want the method to contain any chess knowledge? If so, I'm not sure chess.SE is the best place to get answers.  
  > **username_3**: If you don't start with known positional features, you will be asking your network to recapitulate centuries of chess theory just to get back to where we are now.  A more fruitful approach (it seems to me) would be to start with every known positional feature and have your network learn which ones are important and in which situations.  
  > **username_4**: I am not confident that this is a good application for neural networks.  
  > **username_4**: To be accurate, you'll need more bits, number of moves since the last pawn was moved or piece captured and a bit if a pawn can capture another _en passant_.  
  > **username_0**: @username_1 I have modified Stockfish to dump it's evaluation process into a log file. So every new move(position) it considers is written to a file as an FEN string along with it's eval score  
  > **username_0**: @username_2 I am open to suggestions. Ideally I would like some feature extraction tool like *autoencoders* to take in raw FEN and come up with important features on it's own. If that seems improbable, then I may have to extract them manually and feed it to the neural network  
  > **username_0**: @TonyEnnis yes you are right. As of now only *en passant* and *the 50 move rule* are not incorporated. But my guess is that they will not affect the process very much, at least in the initial stages. Once I can get it up and working, I may include them.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_5 on 2014-02-06. Score: 3
  
  > I do not want to hand pick the features as I want the network to learn everything by itself.
  
  There is an AI-Koan concerning this situation:
  
  > In the days when Sussman was a novice, Minsky once came to him as he
  > sat hacking at the PDP-6.
  >
  > "What are you doing?", asked Minsky.
  >
  > "I am training a randomly wired neural net to play Tic-Tac-Toe" Sussman
  > replied.
  >
  > "Why is the net wired randomly?", asked Minsky.
  >
  > "I do not want it to have any preconceptions of how to play", Sussman said.
  >
  > Minsky then shut his eyes.
  >
  > "Why do you close your eyes?", Sussman asked his teacher.
  >
  > "So that the room will be empty."
  >
  > At that moment, Sussman was enlightened.
  
  Think about it.
  
  > **Comments:**
  > **username_6**: I really like this answer, although it's probably a comment. Why waste years of knowledge and experience and reinvent the wheel...  
  > **username_5**: I think the point is that you have *always* "preconceptions", even if they are "random", even if you decide not to look at them.  
  
  ---
  
  