Backpropagation in Neural Networks
- 55Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is a computation graph?
What is a computation graph?
55 questions
- 1
What is a computation graph?
- A
A table that records only the final outputs of a neural network
- B
A list of model parameters ordered by their numerical values
- C
A cyclic graph that repeatedly applies the same derivative rule
- D
A directed acyclic graph whose nodes represent expressions in a computation
Correct answer
DA directed acyclic graph whose nodes represent expressions in a computation
Explanation
A computation graph is a directed acyclic graph representing a mathematical computation, including its intermediate expressions.
- A
- 2
In a computation graph for a loss function, what does the root node represent?
- A
The first input feature supplied to the model
- B
The parameter that receives the largest gradient
- C
The final expression being computed, such as the loss
- D
The activation function used at the first layer
Correct answer
CThe final expression being computed, such as the loss
Explanation
The root node represents the final expression of the computation, such as the loss function.
- A
- 3
What does an internal node in a computation graph typically represent?
- A
A parameter that must remain fixed during optimization
- B
A gradient that is independent of the model's inputs
- C
A training example that has already been classified correctly
- D
An intermediate subexpression used to compute a larger expression
Correct answer
DAn intermediate subexpression used to compute a larger expression
Explanation
Internal nodes represent intermediate subexpressions, such as a layer's output or a score, that contribute to the final expression.
- A
- 4
How can a computation such as c=a+b be represented in a computation graph?
- A
Input a points to a multiplication operation that produces b
- B
Inputs a and b point directly to the loss without an operation
- C
Inputs a and b point to an addition operation that produces c
- D
Output c points to two separate operations that produce a and b
Correct answer
CInputs a and b point to an addition operation that produces c
Explanation
The graph shows a and b flowing into an addition operation, whose result is labeled c.
- A
- 5
In gradient terms, what does the change in c caused by a small change in a describe?
- A
The local sensitivity of c to a, measured by the derivative of c with respect to a
- B
The rate at which a changes when the value of c is fixed
- C
The number of parameters used to calculate c
- D
The total difference between a and c, regardless of the operation
Correct answer
AThe local sensitivity of c to a, measured by the derivative of c with respect to a
Explanation
The derivative measures how much the output changes in response to a small perturbation of an input.
- A
- 6
For c=a+b, what are the local derivatives with respect to the two inputs?
- A
∂a∂c=2a and ∂b∂c=2b
- B
∂a∂c=1 and ∂b∂c=−1
- C
∂a∂c=b and ∂b∂c=a
- D
∂a∂c=1 and ∂b∂c=1
Correct answer
D∂a∂c=1 and ∂b∂c=1
Explanation
Increasing either input to a sum by a small amount increases the output by that same amount, so both partial derivatives are 1.
- A
- 7
For c=ab, what are the local derivatives with respect to a and b?
- A
∂a∂c=1 and ∂b∂c=1
- B
∂a∂c=a and ∂b∂c=b
- C
∂a∂c=2a and ∂b∂c=2b
- D
∂a∂c=b and ∂b∂c=a
Correct answer
D∂a∂c=b and ∂b∂c=a
Explanation
Holding b fixed, the derivative of ab with respect to a is b; holding a fixed, the derivative with respect to b is a.
- A
- 8
For c=a−b, what is the derivative of c with respect to b?
- A
1, because every input to a two-input operation has derivative 1
- B
−1, because increasing b decreases the difference by the same amount
- C
b, because the derivative equals the input being changed
- D
a, because the other input determines the derivative of subtraction
Correct answer
B−1, because increasing b decreases the difference by the same amount
Explanation
In a−b, increasing b by a small amount decreases c by that amount, so ∂b∂c=−1.
- A
- 9
What is the derivative of the square function c=a2 with respect to its input?
- A
a2
- B
2
- C
a
- D
2a
Correct answer
D2a
Explanation
By the power rule, the derivative of a2 with respect to a is 2a.
- A
- 10
For c=max(a,b) when a=b, what is the derivative with respect to a?
- A
0 for every value of a and b
- B
1 for every value of a and b
- C
1 if a>b, and 0 if a<b
- D
0 if a>b, and 1 if a<b
Correct answer
C1 if a>b, and 0 if a<b
Explanation
If a is the larger input, a small increase in a changes the maximum; if b is larger, a small change in a does not affect it.
- A
- 11
What is the derivative of the logistic function σ(a) with respect to a?
- A
aσ(a)
- B
σ(a)(1−σ(a))
- C
σ(a)2
- D
1−σ(a)
Correct answer
Bσ(a)(1−σ(a))
Explanation
The logistic function has derivative σ(a)(1−σ(a)).
- A
- 12
Why does the derivative of the logistic function approach zero when its input becomes very large or very negative?
- A
The logistic output grows without bound, canceling its derivative
- B
The logistic output becomes equal to its input, making the derivative undefined
- C
The logistic function stops being differentiable outside the interval from 0 to 1
- D
The logistic output saturates near 1 or 0, making σ(a)(1−σ(a)) approach zero
Correct answer
DThe logistic output saturates near 1 or 0, making σ(a)(1−σ(a)) approach zero
Explanation
As the logistic output approaches either 1 or 0, one factor in σ(a)(1−σ(a)) approaches zero.
- A
- 13
How is the derivative of a composition of operations computed along a path in a computation graph?
- A
By adding the local derivatives along the path
- B
By multiplying the local derivatives along the path
- C
By multiplying the intermediate values and ignoring derivatives
- D
By differentiating only the first operation in the path
Correct answer
BBy multiplying the local derivatives along the path
Explanation
The chain rule computes a derivative through a sequence of operations as the product of their local derivatives.
- A
- 14
Suppose b=a2 and c=b2. What is dadc in terms of a?
- A
4a
- B
4a3
- C
2a2
- D
a4
Correct answer
B4a3
Explanation
The local derivatives are dbdc=2b and dadb=2a. Their product is 4ab=4a3, since b=a2.
- A
- 15
Why must the intermediate value b be substituted into the chain-rule result for b=a2 and c=b2?
- A
The derivative is first expressed using the intermediate node, and b=a2 relates it back to the original input
- B
The substitution is needed to turn a product of derivatives into a sum
- C
The intermediate value changes the local derivative of the first operation from 2a to 1
- D
The chain rule applies only when intermediate values are replaced by constants
Correct answer
AThe derivative is first expressed using the intermediate node, and b=a2 relates it back to the original input
Explanation
Multiplying the local derivatives gives 2b⋅2a; using b=a2 expresses the final derivative entirely in terms of a.
- A
- 16
What is the benefit of using local derivative rules as building blocks?
- A
They guarantee that every model has a convex loss
- B
They can be composed to differentiate more complicated computations
- C
They make all intermediate values unnecessary
- D
They eliminate the need to know the operations in a computation
Correct answer
BThey can be composed to differentiate more complicated computations
Explanation
Once local derivatives for basic operations are known, the chain rule combines them to handle larger computations.
- A
- 17
If two paths in a computation graph share some operations, what can this reveal about their gradients?
- A
Their gradient expressions may share common factors from those operations
- B
The shared operations can be omitted from both gradient calculations
- C
Their gradients cannot be computed independently
- D
Their gradients must be equal for every input
Correct answer
ATheir gradient expressions may share common factors from those operations
Explanation
Shared portions of the graph can produce shared subexpressions in the gradients, making the modular structure visible.
- A
- 18
What is the main advantage of expressing a complicated loss as a computation graph before differentiating it?
- A
It removes the need to evaluate the loss on an example
- B
It breaks the calculation into local operations whose derivatives can be composed
- C
It ensures that the loss has a single global minimum
- D
It changes the model so that every parameter has the same gradient
Correct answer
BIt breaks the calculation into local operations whose derivatives can be composed
Explanation
The graph makes intermediate computations explicit, allowing gradients to be calculated from local derivatives and the chain rule.
- A
- 19
How can a four-layer neural network produce a regression prediction, as described?
- A
Take a dot product at every layer but omit intermediate activation functions
- B
Subtract the feature vector from each weight matrix and use the result as the prediction
- C
Repeatedly apply weight matrices and activation functions, then take a final dot product
- D
Apply one activation function to the target, then sum all network weights
Correct answer
CRepeatedly apply weight matrices and activation functions, then take a final dot product
Explanation
The network repeatedly transforms the feature vector with weight matrices and activation functions, then uses a final weight vector to produce a score.
- A
- 20
For a regression example with prediction score s and target y, what loss is described?
- A
(s−y)2
- B
s−y
- C
(s+y)2
- D
y2−s
Correct answer
A(s−y)2
Explanation
The prediction is compared with the target by subtracting y from the score and squaring the residual.
- A
- 21
Why does stochastic gradient descent require gradients with respect to each network parameter?
- A
The gradients ensure that all parameters receive identical updates
- B
Each parameter's gradient indicates how changing that parameter affects the example's loss
- C
Each parameter's gradient gives the exact value of the target for the example
- D
The gradients are needed to determine which features should be removed from the input
Correct answer
BEach parameter's gradient indicates how changing that parameter affects the example's loss
Explanation
Gradient-based updates use each loss derivative to determine how to adjust its corresponding parameter.
- A
- 22
What sequence of computations defines the hinge loss for a linear classifier in the described example?
- A
Compute yTϕ(x), add the margin to 1, then take the minimum with 0
- B
Compute wTϕ(x), multiply by y, subtract the margin from 1, then take the maximum with 0
- C
Compute wTϕ(x), divide by y, add 1, then apply the logistic function
- D
Compute wTϕ(x), subtract y, square the result, then take the maximum with 1
Correct answer
BCompute wTϕ(x), multiply by y, subtract the margin from 1, then take the maximum with 0
Explanation
The score is wTϕ(x), the signed margin is y times that score, and the hinge loss is max(0,1−ywTϕ(x)).
- A
- 23
For hinge loss max(0,1−ywTϕ(x)), what is the gradient with respect to w when the margin is below 1?
- A
−wϕ(x)
- B
−yϕ(x)
- C
ϕ(x)
- D
yϕ(x)
Correct answer
B−yϕ(x)
Explanation
When the margin is below 1, the active loss is 1−ywTϕ(x). Differentiating it with respect to w gives −yϕ(x).
- A
- 24
For the hinge loss above, what is the gradient with respect to w when the margin is greater than 1?
- A
The zero vector, because the loss is locally constant at zero
- B
−yϕ(x), because the margin always contributes to the loss
- C
yϕ(x), because the loss increases with the score
- D
2w, because hinge loss is a squared-weight penalty
Correct answer
AThe zero vector, because the loss is locally constant at zero
Explanation
When the margin exceeds 1, the maximum selects 0, so the loss is locally constant and its gradient is zero.
- A
- 25
What is the role of the feature vector ϕ(x) in the hinge-loss gradient with respect to w?
- A
It determines the gradient only when the margin is greater than 1
- B
It sets the loss to zero whenever the feature vector has nonzero entries
- C
It replaces the label y when determining whether the hinge is active
- D
It provides the direction, scaled by −y, in which the active loss changes with the weights
Correct answer
DIt provides the direction, scaled by −y, in which the active loss changes with the weights
Explanation
When the hinge is active, the gradient is −yϕ(x), so the feature vector supplies the parameter-space direction of change.
- A
- 26
In the two-layer network example, how is the hidden vector h formed?
- A
Square the final score and use it as the input to the first layer
- B
Apply the activation function to the target before multiplying by V
- C
Apply the activation function to the product of the first-layer matrix V and the feature vector
- D
Subtract the target from the product of the final weight vector and the feature vector
Correct answer
CApply the activation function to the product of the first-layer matrix V and the feature vector
Explanation
The first layer multiplies the feature vector by V, and its result is passed through an activation function to obtain h.
- A
- 27
In the two-layer network example, how are the score, residual, and loss related?
- A
The score is wTx, the residual is h minus the score, and the loss is the residual plus y
- B
The score is wTh, the residual is the score plus y, and the loss is the residual squared
- C
The score is wTh, the residual is the score minus y, and the loss is the residual squared
- D
The score is VTx, the residual is y minus the score, and the loss is the residual's absolute value
Correct answer
CThe score is wTh, the residual is the score minus y, and the loss is the residual squared
Explanation
The final weight vector and hidden vector produce the score; subtracting the target gives the residual, which is squared for the loss.
- A
- 28
For the two-layer network with loss r2, residual r=wTh−y, and fixed h, what is the gradient with respect to w?
- A
rh
- B
2hTw
- C
2rh
- D
2rw
Correct answer
C2rh
Explanation
The derivative of r2 with respect to r is 2r, and the derivative of wTh−y with respect to w is h, giving 2rh.
- A
- 29
If the activation is the logistic function applied element-wise, which expression gives the gradient with respect to the first-layer matrix V?
- A
2rhϕ(x)T
- B
2r[w+h+(1−h)]ϕ(x)T
- C
2r[w⊙h]ϕ(x)
- D
2r[w⊙h⊙(1−h)]ϕ(x)T
Correct answer
D2r[w⊙h⊙(1−h)]ϕ(x)T
Explanation
The chain rule combines the loss derivative 2r, the downstream weight vector, the element-wise logistic derivative h⊙(1−h), and the input feature vector in an outer product.
- A
- 30
Why does the gradient with respect to V involve an element-wise product?
- A
The final score adds each component of w to each component of h
- B
The loss function multiplies the feature vector by itself
- C
The matrix V contains only one nonzero entry per row
- D
The activation function is applied separately to each component of the hidden vector
Correct answer
DThe activation function is applied separately to each component of the hidden vector
Explanation
Because the activation is applied element-wise, its derivative is computed for each hidden component, producing an element-wise product in the gradient.
- A
- 31
Why is the gradient of the loss with respect to w in the two-layer network structurally similar to the linear-regression gradient?
- A
The first-layer matrix V disappears from every part of the computation
- B
The hidden vector h serves as the input representation for the final linear score
- C
The derivative with respect to w is independent of the hidden representation
- D
The network's squared loss makes its hidden vector equal to the original features
Correct answer
BThe hidden vector h serves as the input representation for the final linear score
Explanation
For the final linear score wTh, the hidden vector plays the same role that the feature vector plays in a linear predictor.
- A
- 32
Which statement best distinguishes the forward and backward steps of backpropagation?
- A
The forward step computes gradients from output to input; the backward step computes values from input to output
- B
The forward step updates parameters; the backward step evaluates the model's predictions
- C
The forward step stores only parameters; the backward step replaces the computation graph
- D
The forward step evaluates intermediate values from inputs to output; the backward step computes loss sensitivities from output back toward inputs
Correct answer
DThe forward step evaluates intermediate values from inputs to output; the backward step computes loss sensitivities from output back toward inputs
Explanation
Backpropagation first evaluates the graph from its inputs toward the output, then propagates gradient information in the reverse direction.
- A
- 33
What does a forward value at a node represent during backpropagation?
- A
The parameter update that will be applied after training
- B
The number of graph edges between the node and the loss
- C
The derivative of the final loss with respect to every model parameter
- D
The numerical value of the subexpression rooted at that node
Correct answer
DThe numerical value of the subexpression rooted at that node
Explanation
A forward value is the evaluated value of the subexpression represented by that node; it may be a scalar, vector, or matrix.
- A
- 34
In the numerical example with w=(3,1) and x=(1,2), what is the score wTx?
- A
4
- B
5
- C
3
- D
6
Correct answer
B5
Explanation
The dot product is 3⋅1+1⋅2=5.
- A
- 35
In that numerical example, if the score is 5 and the residual is 3, what is the squared loss?
- A
15
- B
9
- C
25
- D
8
Correct answer
B9
Explanation
The residual is 3, so the squared loss is 32=9.
- A
- 36
What is the backward value at the loss node?
- A
The numerical value of the loss at that node
- B
1, because the derivative of the loss with respect to itself is 1
- C
0, because the loss is the final node in the graph
- D
The gradient of the loss with respect to the first model parameter
Correct answer
B1, because the derivative of the loss with respect to itself is 1
Explanation
The backward value at the loss node is the derivative of the loss with respect to itself, which is 1.
- A
- 37
How is a node's backward value computed from a single parent in a simple computation path?
- A
Divide the parent's backward value by the node's forward value
- B
Multiply the parent's backward value by the local derivative on the connecting edge
- C
Multiply the node's forward value by every parameter in the graph
- D
Add the parent's forward value to the local derivative on the connecting edge
Correct answer
BMultiply the parent's backward value by the local derivative on the connecting edge
Explanation
The backward value is propagated by applying the chain rule: multiply the parent's backward value by the local derivative along the edge.
- A
- 38
For the example w=(3,1), x=(1,2), and residual 3, what is the gradient of the squared loss with respect to w?
- A
(3,6)
- B
(12,6)
- C
(6,12)
- D
(6,6)
Correct answer
C(6,12)
Explanation
The squared-loss gradient is 2rx. With r=3 and x=(1,2), it is 6(1,2)=(6,12).
- A
- 39
Why does the backward pass use values saved during the forward pass?
- A
Local derivatives often depend on intermediate values computed in the forward pass
- B
Backward values cannot be calculated unless the loss is convex
- C
The saved values replace the need to apply the chain rule
- D
The forward pass determines which parameters are allowed to change
Correct answer
ALocal derivatives often depend on intermediate values computed in the forward pass
Explanation
For example, the derivative of a square depends on its input, so intermediate forward values are needed to evaluate local derivatives during the backward pass.
- A
- 40
What does a convex training loss for a linear predictor imply under the stated conditions?
- A
With an appropriate step size, gradient descent can converge to a global optimum
- B
Every initialization produces exactly the same sequence of parameter updates
- C
The loss is guaranteed to have no stationary points
- D
The gradient is constant throughout the entire parameter space
Correct answer
AWith an appropriate step size, gradient descent can converge to a global optimum
Explanation
For the convex losses described, using an appropriate step size allows gradient descent to converge to the global optimum.
- A
- 41
What limitation follows from the non-convex training loss of a neural network?
- A
There is no general guarantee that optimization will reach the global minimum
- B
Gradient-based optimization cannot be applied to the network
- C
The network must have a unique local minimum
- D
Every gradient is zero at every initialization
Correct answer
AThere is no general guarantee that optimization will reach the global minimum
Explanation
Non-convexity removes the general guarantee of reaching the global minimum, although optimization can still produce useful results in practice.
- A
- 42
How can initialization affect optimization of a non-convex neural-network loss?
- A
Different starting points can lead optimization toward different regions or minima
- B
Every starting point must converge to the same global minimum
- C
Initialization makes a non-convex loss convex
- D
Initialization affects only the forward computation, never the final solution
Correct answer
ADifferent starting points can lead optimization toward different regions or minima
Explanation
A non-convex loss can have multiple regions of attraction, so the starting point can influence where optimization ends up.
- A
- 43
Why is initializing every row of a neural network's weight matrix to zero problematic in the described setting?
- A
The rows become identical, preventing the units from starting with distinct behaviors
- B
The model can no longer compute a score from its input
- C
All gradients become permanently equal to the target values
- D
The network's loss becomes infinite for every training example
Correct answer
AThe rows become identical, preventing the units from starting with distinct behaviors
Explanation
With zero initialization, the rows of the weight matrix are identical, so the units do not begin with distinct parameters.
- A
- 44
Which initialization strategies are described as alternatives to setting all weights to zero?
- A
Initialize only the final layer and set all earlier layers to zero
- B
Initialize near zero with random noise or use pre-training
- C
Initialize every weight to the target value or use a fixed large constant
- D
Initialize every weight from the same deterministic value
Correct answer
BInitialize near zero with random noise or use pre-training
Explanation
The described approaches include adding random noise around zero and using pre-training to initialize the network.
- A
- 45
What is over-parameterization in the described neural-network setting?
- A
Replacing the hidden layer with a linear predictor
- B
Increasing the learning rate for every parameter
- C
Using more hidden units than are strictly needed
- D
Using fewer training examples than model parameters
Correct answer
CUsing more hidden units than are strictly needed
Explanation
Over-parameterization here means adding more hidden units than are strictly necessary, giving the model more opportunities to learn useful patterns.
- A
- 46
What is the proposed intuition behind using more hidden units than strictly necessary?
- A
Every added unit is guaranteed to learn a distinct useful feature
- B
More units make the loss convex and remove the need for gradient descent
- C
Additional units ensure that no parameter can receive a zero gradient
- D
Some units may be unhelpful, while others may learn useful patterns from the data
Correct answer
DSome units may be unhelpful, while others may learn useful patterns from the data
Explanation
The idea is that some units may not be useful, but a fraction may learn patterns that help fit the data.
- A
- 47
How do adaptive methods such as AdaGrad or Adam differ from using a single fixed step size?
- A
They assign step sizes that can vary by parameter
- B
They assign the same new step size to every parameter after each update
- C
They use one step size for the whole model but change the loss function
- D
They remove the need to compute gradients
Correct answer
AThey assign step sizes that can vary by parameter
Explanation
Adaptive methods can determine a separate step size for each parameter, rather than relying on one shared step size.
- A
- 48
What can happen if gradients vanish during training?
- A
The parameters stop affecting the forward computation
- B
Updates become too small to make meaningful progress
- C
Updates become so large that they necessarily overshoot
- D
The loss becomes convex
Correct answer
BUpdates become too small to make meaningful progress
Explanation
When gradients are very small or close to zero, parameter updates can become too small for training to make progress.
- A
- 49
What can happen if gradients explode during training?
- A
The model's forward values become independent of its parameters
- B
The loss is guaranteed to reach its global minimum immediately
- C
Updates can become excessively large, causing oscillation or divergence
- D
Updates become too small to leave the current parameter values
Correct answer
CUpdates can become excessively large, causing oscillation or divergence
Explanation
Very large gradients can produce excessively large updates, causing optimization to oscillate or diverge.
- A
- 50
Why do initialization, step-size choices, and architecture design matter for controlling gradients?
- A
They guarantee that all neural-network losses are convex
- B
They remove the need to evaluate intermediate activations
- C
They can help prevent gradients from vanishing or exploding
- D
They make every parameter's gradient identical
Correct answer
CThey can help prevent gradients from vanishing or exploding
Explanation
These design and training choices are among the means used to keep gradients from becoming too small or too large.
- A
- 51
Which statement best captures the generality of computation graphs and backpropagation?
- A
They work only when the loss is a squared error
- B
They apply only to neural networks with exactly two layers
- C
They can represent only scalar inputs and scalar outputs
- D
They can be used to compute gradients for many kinds of functions, not just neural networks
Correct answer
DThey can be used to compute gradients for many kinds of functions, not just neural networks
Explanation
Computation graphs and backpropagation are general tools for differentiating many mathematical computations, not only neural networks.
- A
- 52
Why can computation graphs make it easier to develop different models and loss functions?
- A
Their reusable operations let gradients be computed for new compositions of functions
- B
They force every model to use the same architecture and objective
- C
They automatically make each new model's optimization convex
- D
They remove the need to define how a model computes its output
Correct answer
ATheir reusable operations let gradients be computed for new compositions of functions
Explanation
Because the graph is built from composable operations, developers can change models or losses while still using the same general gradient-computation approach.
- A
- 53
What role do computation graphs play in deep-learning packages such as TensorFlow and PyTorch, according to the content?
- A
They support automatic computation of gradients behind the scenes
- B
They select the training labels for each example
- C
They replace the model's forward computation with a lookup table
- D
They guarantee that every trained model reaches a global optimum
Correct answer
AThey support automatic computation of gradients behind the scenes
Explanation
The content describes computation graphs and backpropagation as mechanisms used by deep-learning packages to compute gradients automatically.
- A
- 54
Besides automating gradients, what conceptual benefit can computation graphs provide?
- A
They eliminate the need for local derivative rules
- B
They prove that all gradient expressions have the same form
- C
They show that every neural-network unit contributes equally to the loss
- D
They reveal modular structure and shared subexpressions in gradient calculations
Correct answer
DThey reveal modular structure and shared subexpressions in gradient calculations
Explanation
The graph makes the parts of a computation visible and can expose shared structure in the resulting gradients.
- A
- 55
What is differential programming in the context described?
- A
A model-development approach enabled by building and differentiating computations
- B
A procedure for selecting labels before constructing a computation graph
- C
A method that avoids all differentiation by using only predictions
- D
A rule requiring every model to have a convex training objective
Correct answer
AA model-development approach enabled by building and differentiating computations
Explanation
The content presents differential programming as a model-development paradigm supported by general computation graphs and automatic differentiation.
- A

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