4
votes

I am trying to train model of LSTM layers data of timeseries of categorical (one_hot) action(call/fold/raise) and time. So example time series of 3 rounds where player 2x called and then folded.

  #Call  #0.5s    # Call    #0.3s   #Fold, 1.5s

[[[1,0,0], 0.5], [[1,0,0], 0.3], [[0,1,0], 1.5]]

The categorical array of call/fold/raise cannot be processed by the first layer (LSTM) and I cannot use simple Embedding layer because of the non-categorical time.

First layer - model.add(LSTM(500, return_sequences=True, input_shape=(3, 2)))

I have tried to change the input_shape, but nothing worked for me. Any ideas how to represent one_hot and float in once input?

1

1 Answers

1
votes

You could simply concatenate, no need for embeddings as your one-hot encoding isn't of too high dimensionality and one-hot is an embedding in itself.

So I would try sequences of vectors:

[[1,0,0,0.5], [1,0,0,0.3], [0,1,0,1.5]]

and the LSTM or any layer that you'll use will figure out that the first 3 values mean the action and the last is something else (the time), don't worry about that.

model.add(LSTM(500, return_sequences=True, input_shape=(3, 2)))

should work.