Answers.Body: <blockquote>
  <p>Is the second binary plane all zeros or all ones? Or, something else? How is it known if the move is off the board? For my game, I know if it is a legal move on the board, but do not know if the move is off the board.</p>
  </blockquote>
  <p>The second binary plane is one-hot by definition, there is a single one and everything else is zero. If this definition is not met, it's no longer &quot;one-hot&quot;.</p>
  <p>The paper doesn't state how exactly to implement &quot;off the board&quot; implementation. Research paper wouldn't go into coding level. However, detecting &quot;off the board&quot; is not a challenging task.</p>
  <blockquote>
  <p><a href="https://webcache.googleusercontent.com/search?q=cache:djj-G4T_PwgJ:https://craftychess.com/hyatt/boardrep.html+&amp;cd=2&amp;hl=en&amp;ct=clnk&amp;gl=au" rel="nofollow noreferrer">https://webcache.googleusercontent.com/search?q=cache:djj-G4T_PwgJ:https://craftychess.com/hyatt/boardrep.html+&amp;cd=2&amp;hl=en&amp;ct=clnk&amp;gl=au</a></p>
  </blockquote>
  <blockquote>
  <p>The next step in board representation evolution is to enclose the board inside a larger array, so that illegal squares are &quot;off&quot; the edge and are easily detectable.</p>
  </blockquote>
  <p>A possibility is add borders to your board. Crafty did that. Extend the board to 10x10. Not 9x9 because you need to deal with knight jumping.</p>
  <p>Exactly how you should be doing it is implementation defined. We don't know what Google did because AlphaZero is not open source. I'm here just giving you an example.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-22T04:07:56.930Z
Answers.Text: Thanks! Greatly appreciate you taking time to answer.
Answers.UserDisplayName: MuZeroFm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-16T02:30:34.983Z
Answers.LastActivityDate: 2020-11-16T02:30:34.983Z
Answers.UserDisplayName: SmallChess
Body: <p>From <a href="https://arxiv.org/pdf/1911.08265.pdf#page=13" rel="nofollow noreferrer">the MuZero paper</a> (Appendix E, page 13):</p>
  <blockquote>
  <p>In chess, 8 planes are used to encode the action. The first one-hot plane encodes which position the piece was moved from. The next two planes encode which position the piece was moved to: a one-hot plane to encode the target position, if on the board, and a second binary plane to indicate whether the target was valid (on the board) or not. This is necessary because for simplicity our policy action space enumerates a superset of all possible actions, not all of which are legal, and we use the same action space for policy prediction and to encode the dynamics function input. The remaining five binary planes are used to indicate the type of promotion, if any (queen, knight, bishop, rook, none).</p>
  </blockquote>
  <p>Is the second binary plane all zeros or all ones?  Or, something else?
  How is it known if the move is off the board?  For my game, I know if it is a legal move on the board, but do not know if the move is off the board.</p>
  
Tags: <reinforcement-learning><deep-rl><papers><muzero>
Title: How is MuZero's second binary plane for chess defined?
UserDisplayName: MuZeroFm
ThreadText: # How is MuZero's second binary plane for chess defined?
  
  (Asked by: username_0 on 2020-11-14)
  
  From [the MuZero paper](https://arxiv.org/pdf/1911.08265.pdf#page=13) (Appendix E, page 13):
  
  > In chess, 8 planes are used to encode the action. The first one-hot plane encodes which position the piece was moved from. The next two planes encode which position the piece was moved to: a one-hot plane to encode the target position, if on the board, and a second binary plane to indicate whether the target was valid (on the board) or not. This is necessary because for simplicity our policy action space enumerates a superset of all possible actions, not all of which are legal, and we use the same action space for policy prediction and to encode the dynamics function input. The remaining five binary planes are used to indicate the type of promotion, if any (queen, knight, bishop, rook, none).
  
  Is the second binary plane all zeros or all ones? Or, something else?
  How is it known if the move is off the board? For my game, I know if it is a legal move on the board, but do not know if the move is off the board.
  
  **Tags:** reinforcement-learning, deep-rl, papers, muzero
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-11-16. Score: 2
  
  > Is the second binary plane all zeros or all ones? Or, something else? How is it known if the move is off the board? For my game, I know if it is a legal move on the board, but do not know if the move is off the board.
  
  The second binary plane is one-hot by definition, there is a single one and everything else is zero. If this definition is not met, it's no longer "one-hot".
  
  The paper doesn't state how exactly to implement "off the board" implementation. Research paper wouldn't go into coding level. However, detecting "off the board" is not a challenging task.
  
  > [https://webcache.googleusercontent.com/search?q=cache:djj-G4T\_PwgJ:https://craftychess.com/hyatt/boardrep.html+&cd=2&hl=en&ct=clnk≷=au](https://webcache.googleusercontent.com/search?q=cache:djj-G4T_PwgJ:https://craftychess.com/hyatt/boardrep.html+&cd=2&hl=en&ct=clnk&gl=au)
  
  > The next step in board representation evolution is to enclose the board inside a larger array, so that illegal squares are "off" the edge and are easily detectable.
  
  A possibility is add borders to your board. Crafty did that. Extend the board to 10x10. Not 9x9 because you need to deal with knight jumping.
  
  Exactly how you should be doing it is implementation defined. We don't know what Google did because AlphaZero is not open source. I'm here just giving you an example.
  
  > **Comments:**
  > **username_0**: Thanks! Greatly appreciate you taking time to answer.  
  
  ---
  
  