Recall & Review
beginner
What does 'input shape' mean in a TensorFlow model?
Input shape is the size and structure of the data that the model expects to receive. It tells the model how many features or dimensions each input example has.
Click to reveal answer
beginner
How do you specify the input shape in a TensorFlow Keras Sequential model?
You specify the input shape in the first layer using the 'input_shape' argument, for example: Dense(10, input_shape=(5,)) means each input has 5 features.
Click to reveal answer
intermediate
Why is the batch size not included in the input shape specification?
Batch size is flexible and can change during training or prediction. Input shape only describes the shape of one example, excluding the batch size.
Click to reveal answer
beginner
What is the input shape for a grayscale image of size 28x28 pixels?
The input shape is (28, 28, 1) where 28x28 is the image size and 1 is the number of color channels (grayscale).
Click to reveal answer
intermediate
How does input shape differ for sequence data like text or time series?
For sequence data, input shape usually includes the sequence length and the number of features per step, for example (100, 1) for 100 time steps with 1 feature each.
Click to reveal answer
In TensorFlow Keras, how do you specify the input shape for a model expecting 10 features per example?
✗ Incorrect
The input shape should be a tuple describing the shape of one example, so (10,) means 10 features.
Which part of the input shape is flexible and usually not specified in the model?
✗ Incorrect
Batch size can vary during training or prediction, so it is not fixed in the input shape.
What input shape would you use for a color image of size 64x64 pixels?
✗ Incorrect
Color images usually have 3 channels (red, green, blue), so the shape is (height, width, channels).
For a sequence of 50 time steps with 2 features each, what is the input shape?
✗ Incorrect
The input shape for sequence data is (sequence length, features per step).
If you forget to specify input shape in the first layer of a Sequential model, what happens?
✗ Incorrect
Keras can infer input shape from the first batch of data if not specified explicitly.
Explain how to specify input shape for different types of data in TensorFlow models.
Think about images, tabular data, and sequences.
You got /4 concepts.
Describe why batch size is not part of the input shape and how it affects model training.
Consider how data is fed in groups during training.
You got /4 concepts.