When i go through the 2ed week video, i find that sometimes videos shows tf.keras.layers.Flatten() and sometimes tf.keras.layers.Flatten(input_shape(28,28)). Both of them give the same result, so when should specify the input_shape?
Thank you.
When i go through the 2ed week video, i find that sometimes videos shows tf.keras.layers.Flatten() and sometimes tf.keras.layers.Flatten(input_shape(28,28)). Both of them give the same result, so when should specify the input_shape?
Thank you.
Specifying input_shape
for the 1st layer of the model is sufficient.
The Flatten()
layer is basically used to convert a multidimensional array to a 1D array, so if you know the input shape you want to pass, you can do it. Otherwise, you can just let the layer methods figure out the shapes if you’re not sure of the shape of the target inputs.