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

Study methods

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

Backpropagation and Neural Networks

  • 78Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Optimization Foundations
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What does a classifier function fff take as input and produce as output?

Tap to flipClick to flipspace

It takes data xxx as input and produces a vector of scores, one for each class.

Or swipe the card

78 cards

  1. What does a classifier function fff take as input and produce as output?

    It takes data xxx as input and produces a vector of scores, one for each class.

  2. What is the purpose of a loss function?

    It quantifies how well or poorly the classifier's scores match the desired classification outcomes.

  3. How is the total loss LLL typically constructed?

    It combines a data loss term with a regularization term.

  4. Why is regularization included in a loss function?

    To prefer simpler models that are more likely to generalize well.

  5. How does gradient descent minimize a loss function?

    It repeatedly updates the parameters in the direction of steepest descent, which is the negative gradient.

  6. How do numerical and analytic gradients differ?

    Numerical gradients use finite differences and are slow and approximate; analytic gradients are fast and exact once derived but require calculus and can contain implementation errors.

  7. Why compare an analytic gradient with a numerical gradient?

    To verify that the analytic-gradient implementation and its mathematical derivation are correct.

  8. What is a computational graph?

    A graph representation of a function in which nodes represent individual computation steps and edges represent values passed between steps.

  9. How can a linear classifier and its loss be represented as a computational graph?

    Nodes can compute the matrix product WxW xWx, the data loss, the regularization term, and finally their sum to form the total loss.

  10. What is the main advantage of representing a function as a computational graph?

    It allows backpropagation to compute gradients through complex functions by combining simple local derivatives.

  11. Why are computational graphs especially useful for deep models?

    Deep models contain many transformations, making direct symbolic differentiation impractical.

  12. For f(x,y,z)=(x+y)zf(x,y,z)=(x+y)zf(x,y,z)=(x+y)z, what intermediate variable can simplify the computational graph?

    Define q=x+yq=x+yq=x+y, so that f=qzf=qzf=qz.

  13. For f(x,y,z)=(x+y)zf(x,y,z)=(x+y)zf(x,y,z)=(x+y)z with x=−2x=-2x=−2, y=5y=5y=5, and z=−4z=-4z=−4, what are qqq and fff?

    q=3q=3q=3 and f=−12f=-12f=−12.

  14. What are the local derivatives for the addition node q=x+yq=x+yq=x+y?

    rac{\partial q}{\partial x}=1 and rac{\partial q}{\partial y}=1.

  15. What are the local derivatives for the multiplication node f=qzf=qzf=qz?

    rac{\partial f}{\partial q}=z and rac{\partial f}{\partial z}=q.

  16. What is the forward pass in a computational graph?

    The process of evaluating the graph from inputs to output, computing and often caching each intermediate value.

  17. What is the backward pass in a computational graph?

    The process of propagating gradients from the output backward through the graph using the chain rule.

  18. What is backpropagation?

    Backpropagation is a recursive application of the chain rule that computes gradients with respect to all variables in a computational graph.

  19. What is the initial gradient at the output node during backpropagation?

    The gradient of the output with respect to itself is 111.

  20. For f=qzf=qzf=qz with q=3q=3q=3 and z=−4z=-4z=−4, what are rac{\partial f}{\partial z} and rac{\partial f}{\partial q}?

    rac{\partial f}{\partial z}=q=3 and rac{\partial f}{\partial q}=z=-4.

  21. For f=(x+y)zf=(x+y)zf=(x+y)z with x=−2x=-2x=−2, y=5y=5y=5, and z=−4z=-4z=−4, what are the gradients with respect to xxx, yyy, and zzz?

    rac{\partial f}{\partial x}=-4, rac{\partial f}{\partial y}=-4, and rac{\partial f}{\partial z}=3.

  22. What is an upstream gradient?

    It is the gradient of the final output or loss with respect to a node's immediate output, arriving from later nodes during backpropagation.

  23. How does a node compute the gradient with respect to one of its inputs?

    It multiplies the upstream gradient by the local gradient of its output with respect to that input.

  24. What information does an individual computational node need during backpropagation?

    Its local inputs, its directly computed output, and the local derivatives of that output with respect to its inputs.

  25. Why does backpropagation avoid deriving the gradient of an entire complex expression?

    It decomposes the expression into simple operations and applies the chain rule to their local derivatives.

  26. How are gradients handled when one variable influences multiple downstream nodes?

    The gradients arriving through the different paths are added together.

  27. What does an addition gate do to an upstream gradient?

    It distributes the same upstream gradient to each input.

  28. What does a maximum gate do to an upstream gradient?

    It routes the gradient to the input that attained the maximum and sends a gradient of 000 to the other input.

  29. What does a multiplication gate do to an upstream gradient?

    It scales the upstream gradient by the value of the other input.

  30. What is the sigmoid function?

    The sigmoid function is �sigma(x)= rac{1}{1+e^{-x}}.

  31. What is the derivative of the sigmoid function?

    �sigma′(x)=�sigma(x)(1−�sigma(x))�sigma'(x)=�sigma(x)(1-�sigma(x))�sigma′(x)=�sigma(x)(1−�sigma(x)).

  32. At what level can computational-graph nodes be defined?

    At any granularity, from individual arithmetic operations to larger functions such as a sigmoid gate.

  33. What trade-off determines how much to combine operations into a computational-graph node?

    Combining operations simplifies the graph but may require deriving a more complex local gradient; separating them makes local derivatives simpler.

  34. What is the form of the more complex example function involving weights and inputs?

    f(w,x)= rac{1}{1+e^{-(w_0x_0+w_1x_1+w_2)}}.

  35. Why are forward-pass values needed during the backward pass?

    Local derivatives often depend on values computed during the forward pass, so those values must be retained or cached.

  36. What changes when scalar variables in a computational graph become vectors?

    The forward and backward procedures remain conceptually the same, but gradients become Jacobian matrices or equivalent vectorized operations.

  37. What is a Jacobian matrix?

    A matrix containing the partial derivative of each output component with respect to each input component.

  38. For a mapping from an nnn-dimensional input to an mmm-dimensional output, what is the Jacobian's shape?

    It has shape mmm by nnn.

  39. What is the element-wise maximum operation f(x)=�max(x,0)f(x)=�max(x,0)f(x)=�max(x,0) commonly called?

    It is the ReLU operation, applied element by element.

  40. What is the size of the Jacobian for a 409640964096-dimensional vector mapped element-wise to another 409640964096-dimensional vector?

    It is a 409640964096 by 409640964096 matrix, containing 409624096^240962 entries.

  41. What structure does the Jacobian of an element-wise operation have?

    It is diagonal because each output component depends only on the corresponding input component.

  42. Why is the full Jacobian usually not explicitly computed for element-wise operations?

    Its diagonal structure allows the needed gradient effects to be applied directly without constructing the enormous matrix.

  43. For q=Wxq=Wxq=Wx, what is rac{�partial q_k}{�partial W_{ij}}?

    rac{�partial q_k}{�partial W_{ij}} is xjx_jxj​ when k=ik=ik=i and 000 otherwise.

  44. For q=Wxq=Wxq=Wx, what is rac{�partial q_k}{�partial x_i}?

    WkiW_{ki}Wki​.

  45. For f(q)=�left ont{L2}{q} with squared form f=q12+q22f=q_1^2+q_2^2f=q12​+q22​, what is the gradient with respect to qqq?

    �nablaqf=2q�nabla_q f=2q�nablaq​f=2q.

  46. What shape should the gradient with respect to a vector or matrix variable have?

    It should have the same shape as the variable itself.

  47. How is the gradient with respect to WijW_{ij}Wij​ computed when q=Wxq=Wxq=Wx and fff depends on every component of qqq?

    rac{�partial f}{�partial W_{ij}}=�sum_k rac{�partial f}{�partial q_k} rac{�partial q_k}{�partial W_{ij}}.

  48. What is the vectorized gradient pattern for f(q)=�left ont{L2}{q} where q=Wxq=Wxq=Wx?

    The gradient with respect to qqq is 2q2q2q, and the gradients with respect to WWW and xxx are obtained by chaining this upstream vector through q=Wxq=Wxq=Wx.

  49. What two functions does each computational gate expose in a modular implementation?

    A forward function that computes the output and a backward function that computes input gradients.

  50. In what order should gates be processed during the forward pass?

    In topologically sorted order, so all inputs to a gate are computed before the gate itself.

  51. In what order should gates be processed during the backward pass?

    In reverse topological order, starting at the output and moving toward the inputs.

  52. What does the forward function of a multiplication gate compute?

    Given inputs xxx and yyy, it computes and returns z=xyz=xyz=xy.

  53. What does the backward function of a scalar multiplication gate compute?

    Given upstream gradient dzdzdz, it returns dx=ydzdx= y dzdx=ydz and dy=xdzdy=x dzdy=xdz.

  54. Why should a gate cache values during its forward pass?

    The cached values are often needed to calculate local gradients during the backward pass.

  55. How do deep-learning frameworks commonly represent layers?

    Each layer implements a forward computation and a backward gradient computation, and networks stack these layers together.

  56. What is the basic workflow for finding gradients of a new function using backpropagation?

    Express the function as a computational graph, define intermediate variables, derive local gradients, perform a forward pass, and then apply the chain rule backward.

  57. What is the simplest two-layer neural-network computation described in the lecture?

    Apply a linear transformation W1xW_1xW1​x, a nonlinear activation such as �max(0,W1x)�max(0,W_1x)�max(0,W1​x), and then a second linear transformation W2hW_2hW2​h.

  58. Why must nonlinearities be inserted between stacked linear layers?

    Without nonlinearities, a composition of linear transformations collapses into a single linear function.

  59. What is a neural network in functional terms?

    A hierarchical composition of simpler functions, typically linear layers and nonlinear activation functions.

  60. What is the role of the intermediate activation vector hhh in a two-layer network?

    It contains the activated scores produced by the first layer and serves as input to the next layer.

  61. How can hidden units improve on a single-template linear classifier?

    They allow the network to detect multiple templates or modes and combine them to produce a class score.

  62. What does the first weight matrix W1W_1W1​ represent in the template interpretation?

    Its rows can act as templates that measure the presence of different patterns in the input.

  63. What does the second weight matrix W2W_2W2​ do in the template interpretation?

    It weights and combines the hidden-layer template scores to produce final class scores.

  64. How can a network recognize different orientations of an object?

    It can use separate hidden templates for different orientations and combine their activation scores in a later layer.

  65. What is a deep neural network?

    A neural network with multiple stacked layers of transformations and nonlinearities.

  66. What is the difference between a two-layer network and a one-hidden-layer network?

    They describe the same architecture: a network with two linear or fully connected layers and one hidden layer between the input and output.

  67. What is the relationship between a three-layer network and its number of hidden layers?

    A three-layer network has two hidden layers when the output layer is included in the layer count.

  68. Why are fully connected layers often implemented with matrix multiplication?

    Matrix multiplication computes the activations of an entire layer of neurons efficiently and in vectorized form.

  69. What is the general matrix form of a feed-forward neural network?

    Repeatedly apply a matrix multiplication followed by a nonlinearity, such as h1=�sigma(W1x)h_1=�sigma(W_1x)h1​=�sigma(W1​x) and h2=�sigma(W2h1)h_2=�sigma(W_2h_1)h2​=�sigma(W2​h1​), followed by an output layer.

  70. How are gradients used after backpropagation in a neural network?

    The computed parameter gradients are passed to an optimization method such as gradient descent to update the weights.

  71. What is the biological analogy for the inputs to an artificial neuron?

    They are analogous to signals received through dendrites and synaptic connections from other neurons.

  72. What is the biological analogy for the weighted sum in an artificial neuron?

    It loosely corresponds to integrating incoming signals in a neuron's cell body.

  73. What is the biological analogy for an artificial neuron's output?

    It is loosely analogous to a signal carried to downstream neurons through an axon.

  74. How can an activation function be loosely interpreted biologically?

    It can be viewed as producing an output related to a neuron's firing or spiking rate.

  75. What is the ReLU function?

    ReLU outputs zero for negative inputs and a linear value equal to the input for positive inputs: �mathrmReLU(x)=�max(0,x)�mathrm{ReLU}(x)=�max(0,x)�mathrmReLU(x)=�max(0,x).

  76. Why should biological analogies for artificial neural networks be treated cautiously?

    Biological neurons are much more complex, with diverse neuron types, nonlinear dendritic computations, dynamic synapses, and signaling patterns not captured by simple artificial neurons.

  77. Why is interpreting an activation as a simple firing rate insufficient as a biological model?

    Real neurons communicate through variable spike timing and rates, so a single activation value does not capture their full signaling behavior.

  78. What are fully connected neural networks?

    They are networks whose layers perform matrix multiplications connecting units in one layer to units in the next.

Card 1 of 78
Card 1 of 78

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent