Deep Learning Intro
- 24Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
In the lecture, logistic regression is interpreted as a neural network with which structure?
In the lecture, logistic regression is interpreted as a neural network with which structure?
24 questions
- 1
In the lecture, logistic regression is interpreted as a neural network with which structure?
- A
A hidden layer with multiple neurons followed by a sigmoid output
- B
Multiple neurons with a softmax output layer
- C
A single neuron with a linear part (wx + b) and a sigmoid activation
- D
A single neuron with a ReLU activation
Correct answer
CA single neuron with a linear part (wx + b) and a sigmoid activation
Explanation
Logistic regression is interpreted as a single neuron: linear part wx + b followed by sigmoid activation.
- A
- 2
What does the notation ŷ represent in the logistic regression model for cat detection?
- A
The flattened image vector
- B
The ground truth label indicating presence of a cat
- C
The sigmoid of wx + b, representing the probability of a cat
- D
The linear output wx + b before activation
Correct answer
CThe sigmoid of wx + b, representing the probability of a cat
Explanation
ŷ = σ(wx + b) is the predicted probability that the image contains a cat.
- A
- 3
What is the shape of the weight vector w in logistic regression when the input image is 64×64×3?
- A
64 × 64 × 3
- B
12288 × 12288
- C
12288 × 1
- D
1 × 12288
Correct answer
D1 × 12288
Explanation
The input x is 12288×1 (flattened), so to produce a scalar ŷ, w must be 1×12288.
- A
- 4
How many parameters (weights and biases) does a logistic regression model have when the input dimension is n?
- A
n weights and n biases
- B
n+1 weights and 1 bias
- C
1 weight and n biases
- D
n weights and 1 bias
Correct answer
Dn weights and 1 bias
Explanation
There are n weights (one per input feature) and 1 bias, total n+1 parameters.
- A
- 5
What is the core equation of a neuron as defined in the lecture?
- A
Neuron = sum of weighted inputs plus bias
- B
Neuron = sigmoid of wx + b
- C
Neuron = wx + b
- D
Neuron = linear part + activation function
Correct answer
DNeuron = linear part + activation function
Explanation
A neuron is defined as a linear part (wx + b) followed by an activation function.
- A
- 6
What does the equation 'model = architecture + parameters' mean?
- A
A model consists of a defined architecture (e.g., number of layers and neurons) and the learned parameters (weights and biases)
- B
The architecture determines the parameters, so they are not independent
- C
The architecture is the software and the parameters are the hardware
- D
The model is only the parameters, and the architecture is irrelevant
Correct answer
AA model consists of a defined architecture (e.g., number of layers and neurons) and the learned parameters (weights and biases)
Explanation
Training yields two files: one for architecture and one for parameters; both together constitute the model.
- A
- 7
For a multi-class classification with 3 classes (cat, lion, iguana) using logistic regression neurons, what is the output vector ŷ?
- A
A 3-dimensional vector that sums to 1 due to softmax
- B
A 3-dimensional vector with one element equal to 1 and others 0
- C
A single scalar indicating the most likely class
- D
A 3-dimensional vector, each element being the sigmoid output of a separate neuron
Correct answer
DA 3-dimensional vector, each element being the sigmoid output of a separate neuron
Explanation
With three independent sigmoid neurons, each outputs a probability; the vector ŷ has three elements, each between 0 and 1, but they do not sum to 1.
- A
- 8
How many parameters does a network have with an input of size n, a hidden layer of 3 neurons, and an output layer of 3 neurons (no softmax)?
- A
3n weights and 3 biases, total 3n + 3
- B
n weights and 3 biases, total n + 3
- C
3n + 3 weights and 3 + 3 biases, total 3n + 6
- D
3n + 3 weights and no biases
Correct answer
C3n + 3 weights and 3 + 3 biases, total 3n + 6
Explanation
First layer: 3n weights + 3 biases; second layer: 3×3 = 9 weights + 3 biases; total 3n + 12? Wait, careful: Actually the text says 3n+3 for the first layer (3 neurons, each with n weights and 1 bias) and then for the second layer (3 neurons each with 3 weights and 1 bias) gives 9+3=12 additional, total 3n+15. But the lecture answer: 3n+3? Let's re-check: Actually the lecture says
- A
- 9
What is the purpose of the softmax function in a multi-class neural network?
- A
To ensure that all outputs are between 0 and 1 but not necessarily summing to 1
- B
To apply a sigmoid to each output independently
- C
To reduce the number of output neurons to one
- D
To convert the linear outputs into a probability distribution that sums to 1
Correct answer
DTo convert the linear outputs into a probability distribution that sums to 1
Explanation
Softmax exponentiates the Z values and normalizes by the sum, producing a probability distribution over classes.
- A
- 10
Why does using a softmax output layer make the network not robust to an image containing both a cat and a lion?
- A
Because softmax requires a single correct class label
- B
Because softmax prevents the network from learning multiple objects
- C
Because the softmax outputs must sum to 1, so if both are present, the probabilities cannot both be high
- D
Because softmax works only for binary classification
Correct answer
CBecause the softmax outputs must sum to 1, so if both are present, the probabilities cannot both be high
Explanation
Softmax forces the outputs to sum to 1, so detecting two animals simultaneously would require two high probabilities, which is impossible.
- A
- 11
What is the loss function used for training a single logistic regression neuron (binary classification)?
- A
L = max(0, 1 - y*ŷ)
- B
L = (y - ŷ)^2
- C
L = -sum(y_k log(ŷ_k)) for k classes
- D
L = -[y log(ŷ) + (1-y) log(1-ŷ)]
Correct answer
DL = -[y log(ŷ) + (1-y) log(1-ŷ)]
Explanation
The logistic loss (binary cross-entropy) is L = -[y log(ŷ) + (1-y) log(1-ŷ)].
- A
- 12
For a regression task (e.g., predicting cat age), what activation function is suggested in the lecture for the output neuron?
- A
Softmax
- B
Tanh
- C
Linear or ReLU
- D
Sigmoid
Correct answer
CLinear or ReLU
Explanation
Sigmoid outputs in [0,1] are not suitable for age; linear or ReLU (non-negative) are suggested.
- A
- 13
What loss function is commonly used for regression tasks?
- A
Hinge loss
- B
Categorical cross-entropy
- C
Binary cross-entropy
- D
Mean squared error (L2 loss)
Correct answer
DMean squared error (L2 loss)
Explanation
The lecture mentions using (ŷ - y) squared, i.e., L2 loss for regression.
- A
- 14
In the forward propagation for a neural network with one hidden layer of 3 neurons and an output layer of 1 neuron, what is the shape of Z[1]?
- A
3 × m (for m examples)
- B
3 × 1 (for a single input example)
- C
1 × 1
- D
1 × 3
Correct answer
B3 × 1 (for a single input example)
Explanation
Z[1] = W[1]X + b[1]. With 3 neurons and input size n, W[1] is 3×n, X is n×1, so Z[1] is 3×1.
- A
- 15
When processing a batch of m examples, how does the shape of the weight matrices change compared to processing a single example?
- A
Weight matrices become m times larger
- B
Weight matrices remain the same size; only the input X becomes a matrix of shape n×m
- C
Weight matrices become square matrices of size m×m
- D
Weight matrices become transposed
Correct answer
BWeight matrices remain the same size; only the input X becomes a matrix of shape n×m
Explanation
The number of parameters (weights and biases) is independent of the batch size; only the input matrix expands to accommodate m examples.
- A
- 16
What technique allows adding a bias vector of shape (3,1) to a matrix of shape (3,m) in forward propagation?
- A
Transposing the bias
- B
Using a for loop
- C
Looping over examples
- D
Broadcasting
Correct answer
DBroadcasting
Explanation
Broadcasting (in numPy) automatically repeats the bias column m times to make the addition possible.
- A
- 17
Why is the first hidden layer in a cat detector often found to detect edges?
- A
Because edges are the only features useful for cat detection
- B
Because the loss function forces edge detection
- C
Because it receives raw pixels and can only combine nearby pixel values to detect simple patterns like edges
- D
Because the network is pre-trained on edge detection tasks
Correct answer
CBecause it receives raw pixels and can only combine nearby pixel values to detect simple patterns like edges
Explanation
First layer neurons only see pixels, so the most complex pattern they can learn is edges (combinations of nearby pixels).
- A
- 18
What distinguishes a hidden layer from the input and output layers?
- A
Hidden layers have fewer neurons than input layers
- B
Hidden layers are only present in deep networks
- C
Hidden layers use different activation functions
- D
Hidden layers do not directly see the input or output; they create abstract representations
Correct answer
DHidden layers do not directly see the input or output; they create abstract representations
Explanation
Hidden layers are not directly connected to input or output; they receive from previous layer and pass to next, forming abstractions.
- A
- 19
In backward propagation, why do we compute derivatives starting from the output layer?
- A
Because the output layer is closest to the loss function, making derivatives easier to compute via the chain rule
- B
Because the input layer has more parameters
- C
Because the output layer's parameters are more important
- D
Because we need to compute forward propagation first
Correct answer
ABecause the output layer is closest to the loss function, making derivatives easier to compute via the chain rule
Explanation
The loss depends directly on the output; derivatives w.r.t. later layers are simpler and can be reused for earlier layers via the chain rule.
- A
- 20
What is the key mathematical tool used in backward propagation to compute gradients?
- A
Matrix inversion
- B
Principal component analysis
- C
The chain rule of calculus
- D
The product rule
Correct answer
CThe chain rule of calculus
Explanation
Backpropagation uses the chain rule to decompose the gradient of the loss into manageable parts from output to input.
- A
- 21
What is the difference between loss function L and cost function J when training with a batch of examples?
- A
L is for a single example; J is the average (or sum) of L over the entire batch
- B
L is used in gradient descent; J is used in stochastic gradient descent
- C
L is computed from the output; J is computed from the weights
- D
L is for classification; J is for regression
Correct answer
AL is for a single example; J is the average (or sum) of L over the entire batch
Explanation
Loss L measures error on one example; cost J averages (or sums) L over all examples in the batch.
- A
- 22
In the gradient descent update rule w_l = w_l - α * dJ/dw_l, what does α represent?
- A
The mini-batch size
- B
The regularization parameter
- C
The momentum coefficient
- D
The learning rate, controlling step size
Correct answer
DThe learning rate, controlling step size
Explanation
α is the learning rate, a hyperparameter that scales the gradient update.
- A
- 23
What is a common method to determine the number of layers and neurons per layer for a new problem?
- A
Use a fixed rule: number of neurons = number of input features
- B
Use the architecture of a similar published paper without modification
- C
Try several architectures on a validation set and pick the one with best accuracy
- D
Set number of layers equal to the number of classes
Correct answer
CTry several architectures on a validation set and pick the one with best accuracy
Explanation
The lecture suggests experimenting with different architectures and selecting based on validation performance, aided by experience.
- A
- 24
According to the lecture, what factors contributed to the recent success of deep learning?
- A
New computational methods (GPUs), large amounts of data, and algorithmic innovations
- B
Better theoretical understanding alone
- C
Reduction in data requirements
- D
Increased model complexity without computational advances
Correct answer
ANew computational methods (GPUs), large amounts of data, and algorithmic innovations
Explanation
The lecture cites computational power (GPUs), data availability, and new algorithms as key enablers.
- A

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