Answers.Body: <p>Assuming there's no ordering to the hand (i.e. it doesn't matter what order cards were added to it), then a reasonable approach is to use one input neuron for the number of each kind of card that is present in a player's hand. </p>
  
  <p>You don't describe how the game is played, but a common approach for extracting actions is to have one output neuron for each possible action. To select an action, you would pick the one corresponding to the neuron with the highest output response to a given input.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-08T22:00:58.383Z
Answers.LastActivityDate: 2018-08-08T22:00:58.383Z
Answers.UserDisplayName: John Doucette
Body: <p>I'm attempting to create an AI for a card game using reinforcement learning.  The basics of the game are that you can have (theoretically) up to 35 cards in your hand, you can also have to up to 35 cards 'in play' and so can your opponent.  In normal play you would have ~6 cards in your hand and maybe ~3 each in play.  There are roughly 300 unique cards in total.</p>
  
  <p>How should I represent the game state for the input and how should I represent the action to take in the output?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-07-07T17:31:43.150Z
Comments.Text: Would love to know about the output if u found ur answer!
Comments.UserDisplayName: Haytam
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-09T16:05:22.980Z
Comments.Text: There is room for more detail here that might help get a more precise answer. If there are 300 unique cards, are any repeated (and what is maximum number of each)? Are they complex rules-carrying cards (e.g. Magic the Gathering)? Are card combinations used in a "play" bound by simple or complex rules (a simple rule might be "same suit", or "each card must relate to something already in play")? When you say in "each play", is that actually an atomic action - e.g. all 3 at once - or a sequence of cards during your turn "I play a Foo, then modify it with this Bar, then also change X with this Y"
Comments.UserDisplayName: Neil Slater
Tags: <neural-networks><reinforcement-learning><game-ai>
Title: Representing inputs and outputs for a card game neural network
UserDisplayName: OrangeMan
ThreadText: # Representing inputs and outputs for a card game neural network
  
  (Asked by: username_0 on 2018-07-06)
  
  I'm attempting to create an AI for a card game using reinforcement learning. The basics of the game are that you can have (theoretically) up to 35 cards in your hand, you can also have to up to 35 cards 'in play' and so can your opponent. In normal play you would have ~6 cards in your hand and maybe ~3 each in play. There are roughly 300 unique cards in total.
  
  How should I represent the game state for the input and how should I represent the action to take in the output?
  
  **Tags:** neural-networks, reinforcement-learning, game-ai
  > **Comments:**
  > **username_1**: Would love to know about the output if u found ur answer!  
  > **username_2**: There is room for more detail here that might help get a more precise answer. If there are 300 unique cards, are any repeated (and what is maximum number of each)? Are they complex rules-carrying cards (e.g. Magic the Gathering)? Are card combinations used in a "play" bound by simple or complex rules (a simple rule might be "same suit", or "each card must relate to something already in play")? When you say in "each play", is that actually an atomic action - e.g. all 3 at once - or a sequence of cards during your turn "I play a Foo, then modify it with this Bar, then also change X with this Y"  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2018-08-08. Score: 1 | Accepted answer
  
  Assuming there's no ordering to the hand (i.e. it doesn't matter what order cards were added to it), then a reasonable approach is to use one input neuron for the number of each kind of card that is present in a player's hand.
  
  You don't describe how the game is played, but a common approach for extracting actions is to have one output neuron for each possible action. To select an action, you would pick the one corresponding to the neuron with the highest output response to a given input.
  
  
  ---
  
  