How should I design my input layer for the following classification problem?

Input: 5 cards (from a deck of 52 cards) in a card game;

Output: some classification using a neural network

How should I model the input layer?

Option A: 5 one-hot encodings for the 5 cards, i.e. 5 one-hot vectors of length 52 = 260 input vector. For example


Option B: 5 hot encoding encompassing all 5 cards in one 52 element vector


What are the disadvantages between A and B?


Depends on how your game is played. Is there any meaning assigned to the order of cards, or are all 5 played simultaneously? If order matters, use 5 one-hot vectors so you can choose how to order them, otherwise use a single 5-hot input vector. I would also add that if temporal order matters, you could also use a recurrent net with a 52-element input and feed the five one-hot vectors one after another.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.