Recall & Review
beginner
What does a Flatten layer do in a neural network?
A Flatten layer takes a multi-dimensional input (like an image) and turns it into a single long list of numbers. This helps connect image data to layers that expect flat input.
Click to reveal answer
beginner
What is the purpose of a Dense layer in a neural network?
A Dense layer connects every input to every output neuron with weights. It helps the network learn patterns by combining inputs in different ways.
Click to reveal answer
beginner
Why do we often use a Flatten layer before a Dense layer?
Because Dense layers expect flat input, we use Flatten to convert multi-dimensional data (like images) into a flat list so the Dense layer can process it.
Click to reveal answer
beginner
In TensorFlow, how do you add a Flatten layer to a model?
You add it like this: tf.keras.layers.Flatten(). It will reshape the input to a flat vector automatically.
Click to reveal answer
intermediate
What activation function is commonly used in Dense layers for classification?
The 'softmax' activation is often used in the last Dense layer for multi-class classification to output probabilities.Click to reveal answer
What shape does a Flatten layer output if the input shape is (28, 28, 1)?
✗ Incorrect
Flatten converts the input to a single dimension by multiplying all dimensions: 28*28*1 = 784.
Which layer type connects every input neuron to every output neuron?
✗ Incorrect
Dense layers have full connections between inputs and outputs.
Why is Flatten needed before Dense layers when working with images?
✗ Incorrect
Dense layers require flat input, so Flatten reshapes the image data.
Which activation function is commonly used in the last Dense layer for multi-class classification?
✗ Incorrect
Softmax outputs probabilities for each class, summing to 1.
In TensorFlow, how do you add a Dense layer with 10 neurons and ReLU activation?
✗ Incorrect
You specify the number of neurons and activation function inside Dense.
Explain in your own words why we use a Flatten layer before Dense layers in image classification models.
Think about how images are shaped and what Dense layers expect.
You got /3 concepts.
Describe the role of Dense layers in a neural network and how they learn from data.
Consider how neurons communicate and learn connections.
You got /3 concepts.