Answers.Body: <p>For anyone wondering, I believe to have found the answer:</p>
  <ol>
  <li><p>Yes, it will be an 8x8 plane where all the entries are the same, the number of moves (or mpves with no progress).</p>
  </li>
  <li><p>There are two repetitions planes (for each position from the most recent T=8 positions):</p>
  <p>a) The first repetition plane will be a plane where all the entries are 1's if the position is being repeated for the first time. Else 0's.</p>
  <p>b) The second repetition plane will be a plane where all the entries are 1's if the current position is being repeated for the second time. Else 0's.</p>
  </li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-04T08:06:47.700Z
Answers.LastActivityDate: 2021-03-04T08:06:47.700Z
Answers.UserDisplayName: Andrew
Body: <p>In the Alpha Zero paper (<a href="https://arxiv.org/pdf/1712.01815.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1712.01815.pdf</a>) page 13, the input for the NN is described. In the beggining of the page, the authors state that:</p>
  <p><em>&quot;The input to the Neural Network is an N x X x (MT + L) image stack [...]&quot;</em></p>
  <p>From this, I understand that (for one training example) each input feature is an 8x8 plane. (Technically speaking, every value of every 8x8 plane is a feature, but for the purpose of the question let's suppose that a plane is an input feature).</p>
  <p>In the description of the table on top of the image, the following statement is made:</p>
  <p><em>&quot;[...] Counts are represented by a <strong>single</strong> real-valued input; other input features are represented by a one-hot encoding using thespecified number of binary input planes. [...]&quot;</em></p>
  <p>I understand how they convert the P1 and P2 pieces to one-hot encodings. My questions are:</p>
  <ol>
  <li>When they say <strong>single real-valued input</strong>, since every input feature should be an 8x8 plane, do they mean that they create an 8x8 plane where every entry has the same single-real value? For example, for the 'Total move count' plane, if 10 moves had been played in the game so far, it would look like the one below?</li>
  </ol>
  <pre><code>  move_count_plane = [[10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10]]
  </code></pre>
  <ol start="2">
  <li>For the 'Repetitions' plane, is it the same case as above? They mean a plane where every value is the number of times a specific board setup has been reached? For example, if a specific position has been reached 2 times, then the repetitions plane for that position would be</li>
  </ol>
  <pre><code>  # for a specific timestep in the T=8 step history
    repetitions_plane = [[2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2]]
  </code></pre>
  <p>? Also, why do they keep 2 repetitions planes? Is it one for every player? (8 repetition planes for the past T=8 moves for P1, and more 8 repetition planes for the past T=8 moves for P2?)</p>
  <p>Thanks in advance.</p>
  
Tags: <reinforcement-learning><deep-rl><alphazero><chess>
Title: Clarifying representation of Neural Nerwork input for Chess Alpha Zero
UserDisplayName: Andrew
ThreadText: # Clarifying representation of Neural Nerwork input for Chess Alpha Zero
  
  (Asked by: username_0 on 2021-02-17)
  
  In the Alpha Zero paper (https://arxiv.org/pdf/1712.01815.pdf) page 13, the input for the NN is described. In the beggining of the page, the authors state that:
  "The input to the Neural Network is an N x X x (MT + L) image stack [...]"
  From this, I understand that (for one training example) each input feature is an 8x8 plane. (Technically speaking, every value of every 8x8 plane is a feature, but for the purpose of the question let's suppose that a plane is an input feature).
  In the description of the table on top of the image, the following statement is made:
  "[...] Counts are represented by a single real-valued input; other input features are represented by a one-hot encoding using thespecified number of binary input planes. [...]"
  I understand how they convert the P1 and P2 pieces to one-hot encodings. My questions are:
  
  When they say single real-valued input, since every input feature should be an 8x8 plane, do they mean that they create an 8x8 plane where every entry has the same single-real value? For example, for the 'Total move count' plane, if 10 moves had been played in the game so far, it would look like the one below?
  
    move_count_plane = [[10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10],
                        [10, 10, 10, 10, 10, 10, 10, 10]]
  
  
  For the 'Repetitions' plane, is it the same case as above? They mean a plane where every value is the number of times a specific board setup has been reached? For example, if a specific position has been reached 2 times, then the repetitions plane for that position would be
  
    # for a specific timestep in the T=8 step history
    repetitions_plane = [[2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2],
                         [2, 2, 2, 2, 2, 2, 2, 2]]
  
  ? Also, why do they keep 2 repetitions planes? Is it one for every player? (8 repetition planes for the past T=8 moves for P1, and more 8 repetition planes for the past T=8 moves for P2?)
  Thanks in advance.
  
  **Tags:** reinforcement-learning, deep-rl, alphazero, chess
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-03-04. Score: 6 | Accepted answer
  
  For anyone wondering, I believe to have found the answer:
  
  1. Yes, it will be an 8x8 plane where all the entries are the same, the number of moves (or mpves with no progress).
  2. There are two repetitions planes (for each position from the most recent T=8 positions):
  
     a) The first repetition plane will be a plane where all the entries are 1's if the position is being repeated for the first time. Else 0's.
  
     b) The second repetition plane will be a plane where all the entries are 1's if the current position is being repeated for the second time. Else 0's.
  
  
  ---
  
  