0
0
TensorFlowml~5 mins

Input shape specification in TensorFlow - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Ainput_shape=(10,)
Binput_shape=10
Cinput_shape=[10]
Dinput_shape=(1,10)
Which part of the input shape is flexible and usually not specified in the model?
ANumber of features
BNumber of channels
CSequence length
DBatch size
What input shape would you use for a color image of size 64x64 pixels?
A(3, 64, 64)
B(64, 64)
C(64, 64, 3)
D(64, 3)
For a sequence of 50 time steps with 2 features each, what is the input shape?
A(2,)
B(50, 2)
C(50,)
D(2, 50)
If you forget to specify input shape in the first layer of a Sequential model, what happens?
AModel will automatically infer input shape from data
BModel will raise an error when building
CModel will use default input shape (1,)
DModel will train but with random input shape
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.