0
$\begingroup$

I'm having X_train of shape (1400, 64, 35) and y_train of shape (1400,). I want to give X_train as input to LSTM layer and also want to find the Average (using GlobalAveragePooling Layer) of the Output of LSTM at each time step and give it as input to a Dense Layer. For this problem how to connect the layers and build a sequential model?

I'm using Tensorflow.Keras API's

$\endgroup$
  • $\begingroup$ It would help knowing more about your data, but you could look into ConvLSTM networks. $\endgroup$ – tehem Aug 24 '20 at 15:35
0
$\begingroup$

LSTM takes as input 3 dimension tensors (batch_size,time_step,input). So before adding a LSTM() layer you need to either use Flatten() or TimeDistributed(Flatten()) layer.

this is a basic LSTM model

$\endgroup$

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.