0
0
TensorFlowml~5 mins

Dense (fully connected) layers in TensorFlow - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Dense (fully connected) layer in a neural network?
A Dense layer connects every input neuron to every output neuron with its own weight. It helps the model learn complex patterns by combining all inputs.
Click to reveal answer
beginner
How does a Dense layer transform its input?
It multiplies the input by a weight matrix, adds a bias vector, then applies an activation function to produce the output.
Click to reveal answer
beginner
Why do we use activation functions after Dense layers?
Activation functions add non-linearity, allowing the network to learn complex patterns beyond simple straight lines.
Click to reveal answer
beginner
In TensorFlow, how do you add a Dense layer with 10 neurons and ReLU activation?
Use: tf.keras.layers.Dense(10, activation='relu') inside your model.
Click to reveal answer
intermediate
What happens if you omit the activation function in a Dense layer?
The layer will perform only a linear transformation, limiting the model's ability to learn complex patterns.
Click to reveal answer
What does a Dense layer do in a neural network?
AConnects every input to every output neuron
BOnly connects inputs to outputs with zero weights
CRemoves connections between neurons
DOnly connects neurons in the same layer
Which operation is NOT part of a Dense layer's computation?
AMatrix multiplication of inputs and weights
BAdding bias terms
CApplying an activation function
DPooling inputs
Why do we add activation functions after Dense layers?
ATo remove bias
BTo reduce the number of neurons
CTo add non-linearity so the model can learn complex patterns
DTo make the layer linear
In TensorFlow, how do you create a Dense layer with 5 neurons and no activation?
Atf.keras.layers.Dense(activation='none')
Btf.keras.layers.Dense(5)
Ctf.keras.layers.Dense(5, activation='none')
Dtf.keras.layers.Dense(activation=None)
What is the role of the bias term in a Dense layer?
ATo shift the output and help the model fit data better
BTo multiply inputs
CTo remove noise from data
DTo connect neurons
Explain in your own words what a Dense (fully connected) layer does in a neural network and why it is important.
Think about how every input influences every output and how the layer helps the model learn.
You got /4 concepts.
    Describe how you would add a Dense layer in TensorFlow and what parameters you might specify.
    Consider the basic syntax and common options like activation.
    You got /4 concepts.