Answers.Body: <ul>
  <li>Use one hot encoding for each position, shape <span class="math-container">$(7, 27)$</span>.</li>
  <li>Stack these two dimensions, shape <span class="math-container">$(189)$</span>.</li>
  <li>Tile (replicate) this vector into images of the same resolution, now shape <span class="math-container">$(15, 15, 189)$</span></li>
  <li>Stack them with your other observation, final shape <span class="math-container">$(15, 15, 216)$</span>.</li>
  </ul>
  <p>Another way is instead of replicating the <span class="math-container">$(189)$</span> vector along two axis, you can squeeze them into one single plane of <span class="math-container">$15 * 15 = 225$</span> values, and pad the unfilled part with zeros.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-12T23:52:24.967Z
Answers.LastActivityDate: 2022-08-12T23:52:24.967Z
Answers.UserDisplayName: Uduse
Body: <p>Currently I'm trying to implement Scrabble with MuZero.</p>
  <p>The <span class="math-container">$15 \times 15$</span> game board observation (as input) is of size <span class="math-container">$27 \times15 \times15$</span> (26 letters + 1 wildcard) with a value of 0 or 1.</p>
  <p>However I'm having difficulties finding a suitable way to encode the player's rack of letters (Always 7 letters on the rack).</p>
  <p>The available tiles are: 26 letters <span class="math-container">$(A-Z)$</span> and 1 wildcard.</p>
  <p>A rack can also contain multiple tiles of the same letter.</p>
  <p>Example: rack of player 1 is  <span class="math-container">$[A,A,C,E,T,T,H] -&gt; A:2x, C:1x, E:1x, T:2x, H:1x$</span></p>
  <p>How can I represent a rack of tiles as a <span class="math-container">$(? \times)15 \times15$</span> (or other board size) matrix ?</p>
  
Tags: <reinforcement-learning><game-ai><muzero><observation-spaces><board-games>
Title: Scrabble rack observation with MuZero
UserDisplayName: Thrusticy
ThreadText: # Scrabble rack observation with MuZero
  
  (Asked by: username_0 on 2021-07-20)
  
  Currently I'm trying to implement Scrabble with MuZero.
  
  The $15 \times 15$ game board observation (as input) is of size $27 \times15 \times15$ (26 letters + 1 wildcard) with a value of 0 or 1.
  
  However I'm having difficulties finding a suitable way to encode the player's rack of letters (Always 7 letters on the rack).
  
  The available tiles are: 26 letters $(A-Z)$ and 1 wildcard.
  
  A rack can also contain multiple tiles of the same letter.
  
  Example: rack of player 1 is $[A,A,C,E,T,T,H] -> A:2x, C:1x, E:1x, T:2x, H:1x$
  
  How can I represent a rack of tiles as a $(? \times)15 \times15$ (or other board size) matrix ?
  
  **Tags:** reinforcement-learning, game-ai, muzero, observation-spaces, board-games
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-08-12. Score: 1
  
  * Use one hot encoding for each position, shape $(7, 27)$.
  * Stack these two dimensions, shape $(189)$.
  * Tile (replicate) this vector into images of the same resolution, now shape $(15, 15, 189)$
  * Stack them with your other observation, final shape $(15, 15, 216)$.
  
  Another way is instead of replicating the $(189)$ vector along two axis, you can squeeze them into one single plane of $15 \* 15 = 225$ values, and pad the unfilled part with zeros.
  
  
  ---
  
  