Final exam
Neural Networks Explained
Before you start
- 20 questions, drawn at random from a pool of 34.
- Pass mark: 70%. Your final score is 30% practice + 70% exam.
- No time limit, but finish within 3 hours. You can move between questions before you submit.
- Failed? Review the lessons and try again: every attempt gets a new set of questions.
Question 1 of 20Choose one
What is the main difference between how a neural network and a traditional program solve a problem?
Question 2 of 20True or false
During inference, a trained network keeps updating its weights after every prediction.
Question 3 of 20Work it out
A neuron has inputs (2, −1, 3), weights (0.5, 2, 1) and bias −1.5. What is its weighted sum z?
Question 4 of 20Choose one
What does the bias of a neuron do?
Question 5 of 20True or false
Without nonlinear activation functions, a network with many layers is equivalent to a network with a single linear layer.
Question 6 of 20Match the pairs
Match each activation function to its output range.
Tap an answer, then tap the place where it belongs (or drag it there).
- Sigmoid
- Tanh
- ReLU
- Linear (no activation)
Question 7 of 20Choose one
Why did ReLU largely replace sigmoid in hidden layers?
Question 8 of 20Work it out
How many parameters (weights and biases) does a dense layer with 100 inputs and 20 neurons have?
Question 9 of 20Fill in the blanks
Fill in the blanks
In matrix form, a dense layer computes a = f(), where W is the weight matrix, x the input vector, b the bias vector and f the activation function.
Question 10 of 20Spot the mistake
A study group listed facts about the 784-128-10 digit network. Tap the two statements that are wrong.
Question 11 of 20Match the pairs
Match each task to the loss function that fits it.
Tap an answer, then tap the place where it belongs (or drag it there).
- Predicting the price of a used car
- Classifying an email as spam or not
- Recognizing which of 100 objects is in a photo
Question 12 of 20Work it out
A classifier gives probability 0.9 to the correct class. What is the cross-entropy loss, −ln(p)? Give two decimal places.
Question 13 of 20True or false
Squaring errors in mean squared error makes one large error count more than several small errors that add up to the same total.
Question 14 of 20Choose one
An untrained 5-class classifier spreads its probability evenly across all classes. Roughly what cross-entropy loss should you expect at the start of training?
Question 15 of 20Work it out
For L(w) = (w − 3)2, the gradient is 2(w − 3). Starting at w = 1 with learning rate 0.1, what is w after one gradient descent step?
Question 16 of 20Choose one
What usually happens when the learning rate is far too large?
Question 17 of 20True or false
In high-dimensional networks, most points where the gradient is zero are saddle points rather than poor local minima.
Question 18 of 20What would you do?
What would you do?
After 200 steps, Lee's training loss is falling in a nearly straight line, very slowly, with no sign of instability. What is the most reasonable adjustment?
Question 19 of 20Work it out
A neuron computes z = w·x with x = 4. The gradient of the loss with respect to z is 0.5. What is the gradient of the loss with respect to w?
Question 20 of 20Put in order
Order these events within one training step on a batch.
Drag the items, or use the arrow buttons, to put them in order.
- Optimizer updates all weights and biases
- Backward pass: compute gradients from the output layer back to the first layer
- Compute the loss
- Forward pass: compute predictions and store intermediate values
Question 21 of 20Select all that apply
Which techniques help with vanishing gradients in deep networks? Select all that apply.
Select all that apply.
Question 22 of 20True or false
Backpropagation finds the gradient for each weight by running a separate forward pass with that weight nudged slightly.
Question 23 of 20Work it out
A dataset has 12,800 training examples and the batch size is 64. How many weight updates happen in 5 epochs?
Question 24 of 20Choose one
Why must the test set stay untouched until the final evaluation?
Question 25 of 20Sort into groups
Classify each result as underfitting or overfitting.
Tap an item, then tap its group (or drag it there).
Question 26 of 20Choose one
A hospital model detects a rare disease present in 2% of patients. It reports 98% accuracy. What is the best response?
Question 27 of 20True or false
Weight decay adds a penalty proportional to the sum of squared weights to the loss, encouraging smaller weights.
Question 28 of 20What would you do?
What would you do?
A model for classifying bird photos overfits badly. The team cannot collect more photos. Which approach directly addresses the lack of data?
Question 29 of 20Work it out
A 28 × 28 grayscale image goes through a convolution with a 5 × 5 filter, no padding and stride 1. What is the width of the output feature map?
Question 30 of 20Work it out
A convolutional layer applies 32 filters of size 3 × 3 to an input with 16 channels. How many parameters does it have, including one bias per filter?
Question 31 of 20Choose one
What does a 2 × 2 max pooling layer with stride 2 do to a 16 × 16 feature map?
Question 32 of 20True or false
In self-attention, the attention weights for one token are computed with softmax, so they are positive and add up to 1.
Question 33 of 20Match the pairs
Match each transformer ingredient to its purpose.
Tap an answer, then tap the place where it belongs (or drag it there).
- Query and key vectors
- Value vectors
- Positional information
- Residual connections
Question 34 of 20Select all that apply
Which statements about large language models are accurate? Select all that apply.
Select all that apply.