considering i have the next model and the fact that the dataset is batched as 32. Why don't the batch size is inside the output shape ? If i have BATCH_SIZE=32 , shouldn't have an output shape of (BATCH_SIZE,N_STEPS,N_FEATURES) ? how can i get an output shape like this ?
model = tf.keras.models.Sequential([
tf.keras.layers.LSTM(32, return_sequences=True, input_shape=(N_STEPS, N_FEATURES)),
tf.keras.layers.Bidirectional(tf.keras.layers.LSTM(32, return_sequences=True)),
tf.keras.layers.Dense(N_FEATURES)
])
model.summary()
Model: "sequential"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
lstm (LSTM) (None, 10, 32) 4352
bidirectional (Bidirectiona (None, 10, 64) 16640
l)
dense (Dense) (None, 10, 1) 65
=================================================================
Total params: 21,057
Trainable params: 21,057
Non-trainable params: 0
I'm trying to get an output shape of (BATCH_SIZE,N_STEPS,N_FEAUTURES)
The batch is marked in your summary as None, in all layers shapes. It is None because you have not explicitly passed it to your model. Now to do this you can use batch_input_shape=(BATCH_SIZE,N_STEPS,N_FEAUTURES) instead of input_shape=(N_STEPS, N_FEATURES)
tf.keras.layers.LSTM(32, return_sequences=True, batch_input_shape=(BATCH_SIZE,N_STEPS,N_FEAUTURES)),