Input layer dimension not same as tf dataset

Hello mentor, while I was running lab 1 of week 4, I accidentally set shape of input layer as window_size + 1, which should be window_size. It make the model input layer size not compatible with the tf.dataset object.

.

However, I found that the mode can still be trained and not returning error. May I know how TF’s behaviour for this situation ? Does it add zero to expend the length of training data ? Thanks

Hello @dsfasfuqwjoasjsad

Typically TF must throw a shape mismatch error but in this case, it may silently adjust or ignore the incompatible dimensions if they don’t affect the computation flow, which can sometimes allow training to continue without errors.

However, this may cause unexpected results, as the model isn’t using the intended input shape. It’s best to correct the input layer shape to match your data for better and accurate results.b

Hope it helps!

Thank you!

You’re welcome! happy to help :raised_hands: