1. Home
  2. Explore
  3. Computer Science
  4. Backpropagation in Neural Networks

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Backpropagation in Neural Networks

  • 57Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Neural Network Motivation

How does a four-layer neural network turn a feature vector into a regression prediction?

57 questions

  1. 1

    How does a four-layer neural network turn a feature vector into a regression prediction?

    Model answer

    It repeatedly applies weight matrices and activation functions to the feature vector, then takes a dot product of the final vector with the output weights to produce a score.

    Explanation

    The score is the network's prediction before the regression loss is calculated.

  2. 2

    How is the squared regression loss for one example formed from the network's prediction and target?

    Model answer

    Subtract the target from the prediction to obtain the residual, then square the residual.

    Explanation

    The loss for a prediction y^\hat{y}y^​ and target yyy is (y^−y)2(\hat{y}-y)^2(y^​−y)2.

  3. 3

    Which gradients are needed to train the four-layer network using stochastic gradient descent?

    Model answer

    The gradients of the example's loss with respect to each parameter, including v1v_1v1​, v2v_2v2​, v3v_3v3​, and www.

    Explanation

    These gradients determine how to update the network's weights to reduce its loss.

  4. 4

    Why is manually differentiating a deep network impractical even when the differentiation is straightforward?

    Model answer

    The calculations can be carried out directly, but doing them by hand is tedious and produces many symbolic expressions.

    Explanation

    Computation graphs and backpropagation automate the gradient calculation.

  5. 5

    Why are computation graphs useful beyond automating gradient calculations?

    Model answer

    They also reveal the modular structure of expressions and gradients, making the calculations easier to understand.

    Explanation

    The graph shows how local computations combine into the full expression and its gradient.

  6. 6

    How are computation graphs used by deep-learning software packages?

    Model answer

    Packages such as TensorFlow and PyTorch use computation graphs to automatically compute gradients.

    Explanation

    The graph supplies the structure that automatic differentiation and backpropagation operate on.

  7. 7

    What is a computation graph, and what do its root and other nodes represent?

    Model answer

    It is a directed acyclic graph whose root represents the final expression; other nodes represent intermediate subexpressions.

    Explanation

    For example, a node could represent an intermediate value such as v(x)v(x)v(x).

  8. 8

    How can a basic arithmetic operation be represented as a computation graph?

    Model answer

    The inputs point to a node representing the operation, and the operation's output is labeled as a new value.

    Explanation

    For addition, inputs aaa and bbb feed a plus node whose output is ccc.

  9. 9

    In a computation graph, what does the gradient on an edge describe?

    Model answer

    It describes how much the output of that operation changes in response to a small change in the input on that edge.

    Explanation

    It acts as a local multiplicative factor, or gain, between an input perturbation and the output change.

  10. 10

    What are the local derivatives of c=a+bc=a+bc=a+b with respect to aaa and bbb?

    Model answer

    Both derivatives are 111: ∂c∂a=1\frac{\partial c}{\partial a}=1∂a∂c​=1 and ∂c∂b=1\frac{\partial c}{\partial b}=1∂b∂c​=1.

    Explanation

    A small change in either input changes the sum by the same amount.

  11. 11

    What are the local derivatives of c=abc=abc=ab with respect to its inputs?

    Model answer

    They are ∂c∂a=b\frac{\partial c}{\partial a}=b∂a∂c​=b and ∂c∂b=a\frac{\partial c}{\partial b}=a∂b∂c​=a.

    Explanation

    Perturbing one input changes the product in proportion to the other input.

  12. 12

    What are the local derivatives of the operation a−ba-ba−b with respect to its two inputs?

    Model answer

    The derivative with respect to aaa is 111, and the derivative with respect to bbb is −1-1−1.

    Explanation

    Increasing the subtracted input reduces the result by the same amount.

  13. 13

    What is the derivative of a2a^2a2 with respect to aaa?

    Model answer

    The derivative is 2a2a2a.

    Explanation

    This follows from the power rule.

  14. 14

    What are the local derivatives of max⁡(a,b)\max(a,b)max(a,b) when aaa and bbb are unequal?

    Model answer

    The derivative with respect to aaa is 111 if a>ba>ba>b and 000 if a<ba<ba<b; the derivative with respect to bbb is 111 if b>ab>ab>a and 000 if b<ab<ab<a.

    Explanation

    Only the input that currently determines the maximum affects the output for a small change.

  15. 15

    What is the derivative of the logistic sigmoid σ(a)\sigma(a)σ(a) with respect to its input?

    Model answer

    It is σ(a)(1−σ(a))\sigma(a)(1-\sigma(a))σ(a)(1−σ(a)).

    Explanation

    The derivative can be written using the sigmoid's own output.

  16. 16

    Why does the derivative of the logistic sigmoid approach zero for very large positive or negative inputs?

    Model answer

    The sigmoid saturates near 111 for large positive inputs and near 000 for large negative inputs, making σ(a)(1−σ(a))\sigma(a)(1-\sigma(a))σ(a)(1−σ(a)) approach zero.

    Explanation

    The derivative formula directly shows that it becomes small near either saturation value.

  17. 17

    How can gradients through a sequence of operations be computed from local derivatives?

    Model answer

    Apply the chain rule by multiplying the local derivatives along the path connecting the input to the output.

    Explanation

    Each edge contributes a local gradient factor to the total derivative.

  18. 18

    If b=a2b=a^2b=a2 and c=b2c=b^2c=b2, how can the derivative of ccc with respect to aaa be calculated using the graph?

    Model answer

    Multiply the local derivatives: ∂c∂b=2b\frac{\partial c}{\partial b}=2b∂b∂c​=2b and ∂b∂a=2a\frac{\partial b}{\partial a}=2a∂a∂b​=2a, giving ∂c∂a=4ab=4a3\frac{\partial c}{\partial a}=4ab=4a^3∂a∂c​=4ab=4a3.

    Explanation

    Since b=a2b=a^2b=a2, the result agrees with differentiating c=a4c=a^4c=a4 directly.

  19. 19

    What is the derivative of c=a4c=a^4c=a4 with respect to aaa, and how does it verify the composed-gradient calculation?

    Model answer

    It is 4a34a^34a3, matching the result obtained by multiplying the local derivatives through the two-square computation graph.

    Explanation

    Agreement with the power rule checks the chain-rule calculation.

  20. 20

    How does a computation graph help organize the gradient of a complicated expression?

    Model answer

    It breaks the expression into simpler operations, so each local derivative can be identified and then combined along paths.

    Explanation

    Complicated gradients are built by composing the same basic derivative rules.

  21. 21

    In a computation graph, how is a total gradient along a single path obtained?

    Model answer

    Multiply the gradients on all edges along that path.

    Explanation

    This is the chain rule expressed in graph form.

  22. 22

    What does a gradient with respect to a parameter indicate in terms of perturbations?

    Model answer

    It indicates how much the output or loss changes when that parameter is changed by a small amount.

    Explanation

    The gradient measures the total effect of the perturbation through the connected operations.

  23. 23

    How is the hinge loss computation graph for linear classification built from its main operations?

    Model answer

    Compute the score as a dot product of the weights and features, form the margin using the label and score, then take the maximum of 111 minus the margin and 000.

    Explanation

    The final maximum operation gives the hinge loss.

  24. 24

    For the hinge loss L=max⁡(1−ywTϕ(x),0)L=\max(1-yw^T\phi(x),0)L=max(1−ywTϕ(x),0), when is its gradient with respect to www nonzero?

    Model answer

    It is nonzero when the margin ywTϕ(x)yw^T\phi(x)ywTϕ(x) is less than 111.

    Explanation

    In that case, the first argument of the maximum is positive and determines the loss.

  25. 25

    What is the gradient of the hinge loss with respect to www when the margin is less than 111?

    Model answer

    It is −yϕ(x)-y\phi(x)−yϕ(x).

    Explanation

    The local derivatives contribute the maximum's active branch, a factor of −1-1−1 from subtracting the margin, the label yyy, and the feature vector.

  26. 26

    What is the hinge-loss gradient with respect to www when the margin is greater than 111?

    Model answer

    It is zero.

    Explanation

    The maximum selects 000, so small changes to the weights do not change the loss in this region.

  27. 27

    How does the computation graph make the hinge-loss gradient easier to derive?

    Model answer

    It separates the loss into operations whose local derivatives can be read off and multiplied from the loss back to the weights.

    Explanation

    The graph also labels intermediate quantities such as the score and margin, clarifying which derivative applies at each step.

  28. 28

    How is the score computed in a two-layer neural network with feature vector ϕ(x)\phi(x)ϕ(x)?

    Model answer

    Compute the hidden vector h=σ(Vϕ(x))h=\sigma(V\phi(x))h=σ(Vϕ(x)), then take the dot product of www and hhh to obtain the score.

    Explanation

    The matrix VVV produces hidden-unit inputs, and the activation is applied element-wise.

  29. 29

    How is the squared loss formed in the two-layer neural-network example?

    Model answer

    Subtract the target yyy from the score to get the residual, then square the residual.

    Explanation

    If the score is wThw^ThwTh, the residual is wTh−yw^Th-ywTh−y and the loss is (wTh−y)2(w^Th-y)^2(wTh−y)2.

  30. 30

    What is the gradient of the two-layer network's squared loss with respect to the output weights www?

    Model answer

    It is 2(wTh−y)h2(w^Th-y)h2(wTh−y)h.

    Explanation

    The hidden vector hhh plays the role of the input features for the final linear prediction.

  31. 31

    Why is the gradient with respect to the output weights a useful check against the linear-predictor result?

    Model answer

    It has the same form as the squared-loss gradient for a linear predictor, with the hidden vector hhh replacing the feature vector.

    Explanation

    For a linear predictor, the corresponding gradient is twice the residual times the features.

  32. 32

    What is the gradient of the squared loss with respect to the hidden-layer matrix VVV?

    Model answer

    It is 2(wTh−y)[w⊙h⊙(1−h)]ϕ(x)T2(w^Th-y)[w\odot h\odot(1-h)]\phi(x)^T2(wTh−y)[w⊙h⊙(1−h)]ϕ(x)T.

    Explanation

    The factors come from the squared loss, the output weights, the element-wise sigmoid derivative, and the input features.

  33. 33

    What does the element-wise product symbol mean in the hidden-layer gradient?

    Model answer

    It means that corresponding entries of the vectors are multiplied together.

    Explanation

    The sigmoid is applied to each hidden-unit input separately, so its derivative is also applied element-wise.

  34. 34

    Why do the gradients with respect to www and VVV share some factors?

    Model answer

    Both gradients pass through the same squared-loss and residual computations, so they share the loss derivative and the derivative of the residual with respect to the score.

    Explanation

    A graph makes these shared subexpressions visible.

  35. 35

    What two phases make up the backpropagation algorithm?

    Model answer

    A forward pass computes intermediate values from the leaves to the root, and a backward pass computes gradients from the root back to the leaves.

    Explanation

    The forward values are retained for use in the backward calculations.

  36. 36

    What does a forward value at a computation-graph node represent?

    Model answer

    It is the value of the subexpression represented by that node for the given inputs and parameters.

    Explanation

    A forward value may be a scalar, vector, or matrix.

  37. 37

    What does a backward value at a node represent?

    Model answer

    It is the gradient of the final loss with respect to the value at that node.

    Explanation

    It measures how the loss changes if the node's value changes.

  38. 38

    What is the backward value at the loss node itself?

    Model answer

    It is 111, because the derivative of the loss with respect to itself is 111.

    Explanation

    This provides the starting value for the backward pass.

  39. 39

    How is a node's backward value calculated from its parent's backward value?

    Model answer

    Multiply the parent's backward value by the local gradient on the edge connecting that parent to the node.

    Explanation

    This step applies the chain rule as the backward pass moves toward the leaves.

  40. 40

    In the example with w=(3,1)w=(3,1)w=(3,1) and ϕ(x)=(1,2)\phi(x)=(1,2)ϕ(x)=(1,2), what score and loss are obtained if the residual is 333?

    Model answer

    The score is 555, and the squared loss is 999.

    Explanation

    The dot product is 3⋅1+1⋅2=53\cdot1+1\cdot2=53⋅1+1⋅2=5; squaring the residual gives 32=93^2=932=9.

  41. 41

    In that numerical example, what is the gradient of the squared loss with respect to www?

    Model answer

    It is (6,12)(6,12)(6,12).

    Explanation

    The gradient is twice the residual times the feature vector: 2⋅3⋅(1,2)=(6,12)2\cdot3\cdot(1,2)=(6,12)2⋅3⋅(1,2)=(6,12).

  42. 42

    Why does backpropagation retain intermediate values from the forward pass?

    Model answer

    The backward pass needs those values to evaluate local derivatives at the specific inputs and parameters.

    Explanation

    For example, differentiating a square requires the value of the quantity being squared.

  43. 43

    Does backpropagation apply only to neural networks?

    Model answer

    No. It applies to general computation graphs and can compute gradients for many kinds of mathematical functions and models.

    Explanation

    Neural networks are one important use, not a restriction on the algorithm.

  44. 44

    How does backpropagation fit into stochastic gradient descent?

    Model answer

    Backpropagation computes the loss gradients, and stochastic gradient descent uses them to update the model parameters.

    Explanation

    The gradients indicate how parameter changes affect the loss.

  45. 45

    Why can gradient descent on a convex training loss reach a global minimum under suitable conditions?

    Model answer

    A convex loss has a single global minimum, and gradient descent with an appropriate step size can converge to it.

    Explanation

    The stated guarantee applies to convex losses such as those for linear predictors with a convex loss.

  46. 46

    Why is there no comparable global-minimum guarantee for neural-network training?

    Model answer

    Neural-network training losses are generally non-convex, so gradient descent is not guaranteed to reach a global minimum.

    Explanation

    The method may converge to a local minimum or otherwise fail to reach the global optimum.

  47. 47

    What does the difference between neural-network optimization theory and practice mean?

    Model answer

    Although theory provides no guarantee of finding a global minimum, neural networks often train successfully in practice; the reason for this gap is not fully understood.

    Explanation

    Successful practical results do not remove the theoretical difficulty of non-convex optimization.

  48. 48

    Why does initialization matter when optimizing a non-convex neural-network loss?

    Model answer

    Different starting points can lead the optimization to different regions or local minima.

    Explanation

    Unlike a convex objective, a non-convex objective may have multiple basins of attraction.

  49. 49

    Why can initializing every entry of a neural network's weight matrix to zero be harmful?

    Model answer

    The rows of the weight matrix can remain identical, preventing the hidden units from learning distinct useful representations.

    Explanation

    Random variation helps break this symmetry.

  50. 50

    What are two approaches described for initializing a neural network?

    Model answer

    Initialize weights with small random noise around zero, or use pretraining to initialize the network.

    Explanation

    Both approaches provide alternatives to setting all weights to zero.

  51. 51

    What is over-parameterization in the neural-network setting described?

    Model answer

    It means using more hidden units than are strictly needed.

    Explanation

    This corresponds to having more rows in the hidden-layer weight matrix.

  52. 52

    What is the proposed benefit of over-parameterizing a neural network?

    Model answer

    Having more hidden units gives the network more opportunities to learn useful patterns; some units may be unhelpful while others prove useful.

    Explanation

    The extra units provide additional capacity from which useful representations may emerge.

  53. 53

    How do adaptive step-size methods differ from using a single step size in stochastic gradient descent?

    Model answer

    They assign a separate step size to each parameter rather than using one shared step size.

    Explanation

    Methods such as Adagrad and Adam adjust how quickly each weight moves.

  54. 54

    What can happen if gradients vanish during training?

    Model answer

    Updates become too small, so learning can stall and the model may make little progress.

    Explanation

    Gradients near zero provide little direction for changing the parameters.

  55. 55

    What can happen if gradients explode during training?

    Model answer

    Updates can become too large, causing oscillation or divergence.

    Explanation

    Very large gradients can make parameter changes unstable.

  56. 56

    What design and training choices can help prevent vanishing or exploding gradients?

    Model answer

    Careful initialization, suitable step sizes, and thoughtful neural-network architecture design can help keep gradients from vanishing or exploding.

    Explanation

    These choices affect how gradients propagate and how large parameter updates become.

  57. 57

    Why do computation graphs support rapid experimentation with new models and loss functions?

    Model answer

    They provide a general way to represent mathematical expressions and compute their gradients, so new model structures and losses can be tried without deriving every gradient by hand.

    Explanation

    This generality supports differential programming across many types of functions.

1 of 57
Question 1 of 57

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent