Input shape is the dimension of the input data, for example in case you have image data a Keras model needs an input_shape of (height, width, num_channels) , if you are feeding a model with an input of (3, 1) the model will learn dependences of three consecutive elements. larger the window more information the model considers about the temporal dependences of observations in the sequence.
Sometimes you can have dynamic input shapes ex, images with variable height/width. You can check more details here tf.keras.Input | TensorFlow v2.16.1
According to your statement, the training will be performed by the dependencies of input_shape instead of the shape of the batch’s input samples, right? correct me if I am wrong.
So, what I mean here, for example, the samples are with window 100, the training will still be performed with 3 and ignore the rest of 97?
Btw, the compiler doesn’t give any warnings there…
If I feed one tensor created with your code in the model:
train_set = iter(train_set)
batch = next(train_set)
out = model(batch[0])
you will get the warning:
WARNING:tensorflow:Model was constructed with shape (None, 3, 1) for input KerasTensor(type_spec=TensorSpec(shape=(None, 3, 1), dtype=tf.float32, name='lstm_1_input'), name='lstm_1_input', description="created by layer 'lstm_1_input'"), but it was called on an input with incompatible shape (32, 5, 1)