# How do I represent a multi-dimensional state using a neural network?

I have a set of 15 unique playing cards from a deck of 52 playing cards. A given state is represented by the respective card values in the set of 15 cards, where the card value is a prime number associated with that card. For example, AH is represented by 3.

How should I represent a single state for the NN? Should it be a list of the 15 prime numbers representing the list of cards? I was hoping that I could represent a single state as the sum of each of all 15 prime numbers and then throw that sum through a sigmoid function. My concern, however, is that the NN will lose information if I reduce the dimension of the state to a single attribute (even if that attribute is unique to that state - the sum of n prime numbers is unique compared to the sum of any other n prime numbers).

How important is the dimensionality of each state for Deep Q Learning? I'd really appreciate even some general direction.

• Are there always 15 cards under consideration in your state? For example, do the cards get "played" or split between players to make hands or sets which might vary in size from 15 etc? I can see that as a way that you lose information, unless you also track $n$ for each group of cards being represented. May 16, 2019 at 9:53
• The size would vary, but I can keep track of $n$. May 16, 2019 at 9:55
• @NeilSlater Since the size of $n$ is decreasing by 1 (a card is discarded) every round, would it be better to have $n$ neural networks for each hand length or just input an empty card (say a value of 0) to the remaining input nodes? May 16, 2019 at 10:41
• I don't want to answer in the comments. However, the clarification that n could vary does mean that just the pure sum of numbers is not enough to guarantee uniqueness because e.g. $2 + 3 = 5$ - so you cannot represent the whole state of play in the way that you hope May 16, 2019 at 12:41
• So, assuming I used some sort of binary or one-hot encoding, what would you suggest I do in regards to my previous question? Thanks for the help btw! I am quite new to NN May 16, 2019 at 12:42