Neural Networks & Gradient Descent
- 21Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the input size of the neural network described for digit recognition?
What is the input size of the neural network described for digit recognition?
21 questions
- 1
What is the input size of the neural network described for digit recognition?
- A
10 neurons, each corresponding to a digit class
- B
28 neurons, each corresponding to a row of pixels
- C
784 neurons, each corresponding to a binary black/white value
- D
784 neurons, each corresponding to a pixel value between 0 and 1
Correct answer
D784 neurons, each corresponding to a pixel value between 0 and 1
Explanation
The input layer has 784 neurons, representing each pixel of the 28x28 image with grayscale values from 0 to 1.
- A
- 2
How is the activation of a neuron in a hidden layer computed?
- A
A simple average of all activations from the previous layer
- B
A weighted sum of all outputs from the next layer, minus a bias
- C
A weighted sum of all activations from the previous layer plus a bias, then passed through an activation function
- D
A weighted sum of all activations from the previous layer, then normalized to sum to 1
Correct answer
CA weighted sum of all activations from the previous layer plus a bias, then passed through an activation function
Explanation
Each neuron's activation is the result of a weighted sum of all previous layer activations plus a bias, followed by a nonlinear activation function like sigmoid or ReLU.
- A
- 3
What determines the digit classification in the output layer?
- A
The neuron with the lowest activation among the 10 output neurons
- B
The neuron with the highest activation among the 10 output neurons
- C
The sum of all 10 output activations
- D
The average of all 10 output activations
Correct answer
BThe neuron with the highest activation among the 10 output neurons
Explanation
The network classifies a digit by selecting the output neuron with the highest activation, as that corresponds to the predicted digit.
- A
- 4
What is the purpose of the cost function in neural network training?
- A
To measure the accuracy of the network on new test data
- B
To calculate the gradient of the activation function
- C
To measure how poorly the network performs on the training data
- D
To determine the optimal number of hidden layers
Correct answer
CTo measure how poorly the network performs on the training data
Explanation
The cost function quantifies the difference between the network's output and the desired output, providing a measure of how 'lousy' the network is, which we then minimize.
- A
- 5
How is the cost for a single training example defined?
- A
The number of incorrect classifications in the output layer
- B
The sum of absolute differences between actual output activations and desired activations
- C
The sum of squared differences between actual output activations and desired activations
- D
The cross-entropy between actual and desired output distributions
Correct answer
CThe sum of squared differences between actual output activations and desired activations
Explanation
The cost for one example is the sum of squared differences between each actual output activation and the target value (1 for correct neuron, 0 for others).
- A
- 6
Why must the cost function have a smooth output?
- A
To enable gradient descent by allowing the computation of slopes and local minima
- B
To make the cost function independent of the training data
- C
To allow the network to memorize training examples exactly
- D
To ensure the network can handle binary activations
Correct answer
ATo enable gradient descent by allowing the computation of slopes and local minima
Explanation
A smooth cost function allows gradient descent to work by providing continuous slopes that can be followed downhill to find a local minimum.
- A
- 7
What is gradient descent in the context of neural networks?
- A
Computing the exact minimum of the cost function using calculus
- B
Randomly adjusting weights and biases until the cost decreases
- C
Repeatedly nudging the weights and biases in the direction of the negative gradient of the cost function
- D
Increasing all weights by a fixed amount to reduce the cost
Correct answer
CRepeatedly nudging the weights and biases in the direction of the negative gradient of the cost function
Explanation
Gradient descent involves repeatedly moving the parameters (weights and biases) in the direction of the negative gradient of the cost function to decrease its value.
- A
- 8
What does the gradient of the cost function indicate?
- A
The direction of steepest descent and the flatness of the function
- B
The direction of steepest ascent and the steepness of the slope
- C
The global minimum of the cost function
- D
The average value of the cost function over all inputs
Correct answer
BThe direction of steepest ascent and the steepness of the slope
Explanation
The gradient gives the direction of steepest increase; its negative gives the direction of steepest decrease, and its magnitude indicates the steepness.
- A
- 9
In gradient descent, why is the step size made proportional to the slope?
- A
To avoid overshooting the minimum as the slope flattens
- B
To ensure that the algorithm always converges to the global minimum
- C
To reduce the number of training examples needed
- D
To increase the speed of convergence regardless of the slope
Correct answer
ATo avoid overshooting the minimum as the slope flattens
Explanation
When the slope is steep, larger steps are taken; as it flattens near a minimum, smaller steps help prevent overshooting and allow convergence.
- A
- 10
What does the negative gradient vector encode about the weights and biases?
- A
The relative importance of each weight and bias; which changes matter most
- B
The learning rate for each parameter
- C
The absolute values of all weights and biases
- D
The sign of each weight and bias but not their magnitude
Correct answer
AThe relative importance of each weight and bias; which changes matter most
Explanation
The components of the negative gradient indicate how much each weight or bias contributes to decreasing the cost; larger magnitudes mean more 'bang for your buck'.
- A
- 11
What performance did the network with two hidden layers of 16 neurons achieve on new test images?
- A
About 98% accuracy
- B
About 99% accuracy
- C
About 90% accuracy
- D
About 96% accuracy
Correct answer
DAbout 96% accuracy
Explanation
The described network with two hidden layers of 16 neurons achieved around 96% accuracy on the test set.
- A
- 12
When visualizing the weights from the first layer to a neuron in the second layer, what did the learned patterns look like?
- A
Almost random, with only loose patterns in the center
- B
Clearly defined edges and simple shapes
- C
Uniform gray with no discernible structure
- D
Complete copies of digit images
Correct answer
AAlmost random, with only loose patterns in the center
Explanation
Instead of picking up on edges, the weights appeared almost random with only some loose patterns, contrary to the initial hope.
- A
- 13
How does the network respond to a completely random image input?
- A
It confidently classifies the random noise as a specific digit
- B
It evenly activates all output neurons
- C
It produces an error message due to invalid input
- D
It shows uncertainty by not activating any output neuron strongly
Correct answer
AIt confidently classifies the random noise as a specific digit
Explanation
The network confidently (but incorrectly) classifies random noise as a digit because its training never incentivized uncertainty.
- A
- 14
What was the motivation for the layered structure in the network?
- A
That lower layers detect edges, middle layers detect patterns, and the top layer combines them for digit recognition
- B
That each layer independently classifies the digit and votes
- C
That the network should memorize all training examples exactly
- D
That the number of neurons should decrease geometrically
Correct answer
AThat lower layers detect edges, middle layers detect patterns, and the top layer combines them for digit recognition
Explanation
The hope was that the layers would learn increasingly complex features: edges in layer 2, patterns in layer 3, and digits in the output layer.
- A
- 15
What does the paper discussed about training on randomly labeled data demonstrate?
- A
Networks cannot achieve any accuracy above chance on random labels
- B
Training on random labels is impossible because the gradient vanishes
- C
Random labels cause the cost function to become non-differentiable
- D
A network can achieve high training accuracy by memorizing the random labels
Correct answer
DA network can achieve high training accuracy by memorizing the random labels
Explanation
The paper showed that a deep network could still achieve high training accuracy on shuffled labels by memorizing the data, even though test accuracy was random.
- A
- 16
What difference was observed between training on structured data versus random labels?
- A
Structured data leads to faster convergence only when using more layers
- B
On structured data, the accuracy curve drops quickly; on random labels, it decreases slowly and linearly
- C
Both datasets produce similar accuracy curves with rapid initial drops
- D
On structured data, the accuracy curve decreases slowly; on random labels, it drops quickly
Correct answer
BOn structured data, the accuracy curve drops quickly; on random labels, it decreases slowly and linearly
Explanation
With properly labeled structured data, the accuracy improves rapidly early in training, whereas with random labels it improves very slowly, indicating difficulty finding a minimum.
- A
- 17
What do the results on random labels suggest about the optimization landscape?
- A
Local minima are only found on structured data; random labels lead to saddle points
- B
Local minima that neural networks find are of equal quality, and structured data makes finding them easier
- C
The optimization landscape has many global minima that networks can find equally well
- D
Structured data creates a convex landscape, while random labels create a non-convex one
Correct answer
BLocal minima that neural networks find are of equal quality, and structured data makes finding them easier
Explanation
The discussion referenced a paper showing that local minima found by networks tend to be of similar quality, and structured data enables finding one more easily.
- A
- 18
What is the algorithm that efficiently computes the gradient of the cost function in a neural network?
- A
Forward propagation
- B
Stochastic gradient descent
- C
Gradient boosting
- D
Backpropagation
Correct answer
DBackpropagation
Explanation
Backpropagation is the algorithm used to efficiently compute the gradient of the cost function with respect to all weights and biases.
- A
- 19
Why do artificial neurons use continuously ranging activations rather than binary ones?
- A
To mimic biological neurons more accurately
- B
To ensure the cost function is smooth and differentiable, enabling gradient descent
- C
To reduce the number of weights needed
- D
To allow the network to process color images
Correct answer
BTo ensure the cost function is smooth and differentiable, enabling gradient descent
Explanation
Continuous activations make the cost function smooth, which is necessary for gradient-based learning.
- A
- 20
Approximately how many weights and biases does the described network have?
- A
About 784
- B
About 13,000
- C
About 1,000
- D
About 130,000
Correct answer
BAbout 13,000
Explanation
The network with two hidden layers of 16 neurons has roughly 13,000 adjustable weights and biases.
- A
- 21
What is the definition of the average cost over all training examples?
- A
The maximum cost among all training examples
- B
The average of the individual costs for each training example
- C
The sum of the costs for all training examples
- D
The median cost across training examples
Correct answer
BThe average of the individual costs for each training example
Explanation
The cost function used for gradient descent is the average (or sum) of the individual costs over all training examples.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.