2
$\begingroup$

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

[
[0,0,0,0,0,0,1,...],
[1,0,0,0,0,0,0,...],
[0,0,0,0,0,1,0,...],
[0,0,1,0,0,0,0,...],
[0,0,0,0,1,0,0,...]
]

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

[1,0,1,0,1,1,1,...]

What are the disadvantages between A and B?

$\endgroup$

1 Answer 1

2
$\begingroup$

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.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .