Neural Networks & Gradient Descent
- 23Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the input to the neural network for handwritten digit recognition?
23 questions
- 1
What is the input to the neural network for handwritten digit recognition?
Model answer
A 28x28 pixel grid with grayscale values between 0 and 1, resulting in 784 input neurons.
Explanation
The input layer has 784 neurons corresponding to each pixel's grayscale value.
- 2
How are activations of neurons in subsequent layers determined?
Model answer
By a weighted sum of all activations in the previous layer plus a bias, then composed with an activation function like sigmoid or ReLU.
Explanation
Each neuron's activation depends on the weighted sum of previous layer outputs and a bias, passed through a nonlinear function.
- 3
How many neurons are in each hidden layer in the described network?
Model answer
Two hidden layers with 16 neurons each.
Explanation
The network uses two hidden layers of 16 neurons as a somewhat arbitrary choice.
- 4
Approximately how many weights and biases does the network have?
Model answer
About 13,000.
Explanation
The total number of adjustable parameters in the network is roughly 13,000.
- 5
How does the network classify a digit?
Model answer
The brightest of the 10 output neurons corresponds to the digit.
Explanation
The output layer has 10 neurons, and the one with highest activation indicates the network's guess.
- 6
What is the purpose of gradient descent in neural network learning?
Model answer
To minimize the cost function by repeatedly stepping in the direction of the negative gradient.
Explanation
Gradient descent iteratively adjusts weights and biases to reduce the cost function.
- 7
For a function with one input, how do you find a local minimum using gradient descent?
Model answer
Start at a random input, compute the slope, and step left if the slope is positive, right if negative, with step size proportional to slope.
Explanation
Repeatedly moving opposite the slope direction leads to a local minimum.
- 8
What does the gradient of a function with multiple inputs indicate?
Model answer
The direction of steepest ascent; the negative gradient gives the direction of steepest descent.
Explanation
The gradient vector points uphill; moving opposite to it reduces the function most quickly.
- 9
In gradient descent, why are step sizes proportional to the slope?
Model answer
As the slope flattens near a minimum, steps get smaller, helping to avoid overshooting.
Explanation
Proportional step sizes allow the algorithm to converge without bouncing around the minimum.
- 10
How is the cost function defined for a single training example?
Model answer
Sum of squares of differences between the network's output activations and the desired target activations.
Explanation
The cost for one example measures the squared error between actual and expected outputs.
- 11
What does the average cost over all training examples represent?
Model answer
A measure of how poorly the network performs on the entire training set.
Explanation
The average cost quantifies overall network lousiness across all training data.
- 12
Why is a smooth cost function important for gradient descent?
Model answer
To allow the network to find a local minimum by taking small steps downhill.
Explanation
Smoothness ensures that the gradient is defined and gradient descent can be applied.
- 13
Why do artificial neurons have continuously ranging activations instead of binary?
Model answer
To ensure the cost function is smooth and differentiable for gradient descent.
Explanation
Binary activations would make the cost function nonsmooth, preventing gradient-based optimization.
- 14
What are the weights and biases initially set to?
Model answer
Random values.
Explanation
The network starts with random weights and biases before training.
- 15
What is the name of the algorithm used to compute the gradient efficiently?
Model answer
Backpropagation.
Explanation
Backpropagation efficiently computes the gradient of the cost function with respect to weights and biases.
- 16
How does minimizing the cost function improve the network's performance?
Model answer
It makes the network's output on training data look less random and more like the desired decisions.
Explanation
Lower cost means outputs are closer to target labels, improving classification accuracy.
- 17
What classification accuracy does the described network achieve on new images?
Model answer
About 96%, and up to 98% with tweaks.
Explanation
The basic network achieves 96% test accuracy; with modifications it can reach 98%.
- 18
How does the network's performance on random noise images illustrate a limitation?
Model answer
It confidently classifies random noise as a digit, showing overconfidence and lack of understanding.
Explanation
The network outputs high confidence for random inputs because it was never trained on such examples.
- 19
What do the weights from the first layer to a neuron in the second layer look like when visualized?
Model answer
Almost random patterns with loose patterns in the middle, not isolated edges.
Explanation
Visualizing weights shows they do not form edge detectors but appear nearly random.
- 20
Does the network actually learn to recognize edges and patterns as initially hypothesized?
Model answer
No, it finds a local minimum that works but does not pick up on the expected patterns.
Explanation
The network's hidden layers do not correspond to edge or pattern detectors as hypothesized.
- 21
What did the label shuffling experiment demonstrate?
Model answer
A deep network could achieve high training accuracy even with randomly shuffled labels, suggesting it can memorize data.
Explanation
With shuffled labels, the network still reached high training accuracy, indicating memorization rather than learning structure.
- 22
How does training on structured vs random data differ in terms of the optimization landscape?
Model answer
On structured data, accuracy improves quickly, while on random data, it improves slowly and linearly.
Explanation
Structured data has a more favorable optimization landscape, making it easier to find good local minima.
- 23
What does the paper about optimization landscape suggest about local minima?
Model answer
Local minima that networks tend to learn are of equal quality.
Explanation
The paper indicates that all local minima found are similar in performance, making structured data easier to optimize.

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