1. Home
  2. Explore
  3. Computer Science
  4. Training Neural Networks

Study methods

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

Training Neural Networks

  • 69Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Training Optimization

In the neural-network training setup described, what role does the ground-truth label yyy play?

69 questions

  1. 1

    In the neural-network training setup described, what role does the ground-truth label yyy play?

    1. A

      It supplies the gradient used to initialize the model’s parameters.

    2. B

      It specifies the learning rate used to update the model’s parameters.

    3. C

      It provides the target against which the model’s prediction is compared to calculate loss.

    4. D

      It determines which layers are included in the model’s forward pass.

    Correct answer
    C

    It provides the target against which the model’s prediction is compared to calculate loss.

    Explanation

    For an input xxx, the model produces a prediction, and the loss measures the difference between that prediction and the ground-truth target yyy.

  2. 2

    What does it mean for a neural network’s parameters to be learned during training?

    1. A

      Their values are replaced by the ground-truth labels after each forward pass.

    2. B

      Their numerical values are fixed while the input examples are changed to fit the model.

    3. C

      Their number is increased until the model can represent every training example exactly.

    4. D

      Their numerical values are adjusted so the model’s loss becomes smaller on available data.

    Correct answer
    D

    Their numerical values are adjusted so the model’s loss becomes smaller on available data.

    Explanation

    Learning means adjusting the parameter values in numerical space to find values that reduce the loss on the data available for training.

  3. 3

    How is the training cost J(θ)J(\theta)J(θ) described in the lecture?

    1. A

      As the largest individual loss among all training examples.

    2. B

      As the sum of individual losses over the training data set.

    3. C

      As the sum of all model parameters, independent of the data.

    4. D

      As the difference between training loss and test loss.

    Correct answer
    B

    As the sum of individual losses over the training data set.

    Explanation

    The cost is defined as the sum of the losses over the data points in the training set.

  4. 4

    Which statement describes what can be evaluated for a specified parameter setting θ\thetaθ?

    1. A

      The gradient can be evaluated only after the global minimum is already known.

    2. B

      The cost can be evaluated, but neither its gradient nor its Hessian can be calculated.

    3. C

      Only the Hessian can be evaluated; the cost and gradient must be estimated from labels.

    4. D

      The cost J(θ)J(\theta)J(θ) and its gradient can be evaluated, and a Hessian can also be calculated.

    Correct answer
    D

    The cost J(θ)J(\theta)J(θ) and its gradient can be evaluated, and a Hessian can also be calculated.

    Explanation

    The lecture describes evaluating the cost and its gradient at a given parameter setting, and says that second-order information such as the Hessian can also be calculated, although it is less commonly used in practice.

  5. 5

    Why is first-order optimization more commonly emphasized than second-order optimization in neural-network training?

    1. A

      It eliminates the need to evaluate the model’s loss on data.

    2. B

      It uses gradient information without usually requiring explicit Hessian calculations.

    3. C

      It updates parameters without using any information about the loss landscape.

    4. D

      It guarantees a global minimum even when the loss landscape is non-convex.

    Correct answer
    B

    It uses gradient information without usually requiring explicit Hessian calculations.

    Explanation

    The lecture says practice usually focuses on first-order optimization, using a gradient approximation, rather than explicitly calculating the Hessian.

  6. 6

    For a gradient-descent step with learning rate η\etaη, which update moves parameters toward lower cost?

    1. A

      θk+1=θk−η∇J(θk)\theta_{k+1}=\theta_k-\eta\nabla J(\theta_k)θk+1​=θk​−η∇J(θk​)

    2. B

      θk+1=θk−∇2J(θk)\theta_{k+1}=\theta_k-\nabla^2J(\theta_k)θk+1​=θk​−∇2J(θk​)

    3. C

      θk+1=ηθk−∇J(θk)\theta_{k+1}=\eta\theta_k-\nabla J(\theta_k)θk+1​=ηθk​−∇J(θk​)

    4. D

      θk+1=θk+η∇J(θk)\theta_{k+1}=\theta_k+\eta\nabla J(\theta_k)θk+1​=θk​+η∇J(θk​)

    Correct answer
    A

    θk+1=θk−η∇J(θk)\theta_{k+1}=\theta_k-\eta\nabla J(\theta_k)θk+1​=θk​−η∇J(θk​)

    Explanation

    Gradient descent steps opposite the gradient, which points in the direction of steepest increase; η\etaη controls the step size.

  7. 7

    Why might gradient descent fail to find the global minimum of a non-convex cost function?

    1. A

      A non-convex cost function cannot be evaluated at any parameter setting.

    2. B

      A non-convex cost function prevents parameters from being updated.

    3. C

      The gradient is guaranteed to be zero everywhere on a non-convex landscape.

    4. D

      The optimization can converge to a local minimum instead of the global minimum.

    Correct answer
    D

    The optimization can converge to a local minimum instead of the global minimum.

    Explanation

    A non-convex landscape may contain multiple minima, so the result can depend on the starting point and may be only a local minimum.

  8. 8

    Why can calculating a gradient over every training example at every update be impractical?

    1. A

      Large data sets can make full-data gradient calculations too slow or computationally costly.

    2. B

      The full-data gradient cannot be defined for a neural network with multiple layers.

    3. C

      Using every example forces the cost function to become non-differentiable.

    4. D

      A full-data gradient requires the training labels to be discarded.

    Correct answer
    A

    Large data sets can make full-data gradient calculations too slow or computationally costly.

    Explanation

    As data sets grow, calculating the overall loss gradient over every example can become prohibitively slow or computationally intractable.

  9. 9

    What does a batch size of 111 mean for parameter updates?

    1. A

      The parameters are updated after each individual example is processed.

    2. B

      The parameters are updated once after the entire data set is processed.

    3. C

      The parameters are updated using one randomly selected model parameter.

    4. D

      The parameters are updated after one full epoch but not between examples.

    Correct answer
    A

    The parameters are updated after each individual example is processed.

    Explanation

    With batch size 111, a parameter update follows each individual training example.

  10. 10

    What does a batch size equal to the full data-set size correspond to?

    1. A

      Standard gradient descent using the gradient over the entire data set.

    2. B

      An evolution strategy that perturbs the parameter values.

    3. C

      An update based on one randomly selected training example.

    4. D

      A momentum update that ignores the current gradient.

    Correct answer
    A

    Standard gradient descent using the gradient over the entire data set.

    Explanation

    When the batch contains all NNN examples, its gradient is the full-data gradient used in standard gradient descent.

  11. 11

    What assumption makes stochastic gradient descent practical?

    1. A

      The cost of a model does not depend on which examples are sampled.

    2. B

      A gradient computed on a subset of examples can reasonably approximate the full-data gradient.

    3. C

      The training examples in each batch have identical labels.

    4. D

      A gradient computed on one batch is always exactly equal to the full-data gradient.

    Correct answer
    B

    A gradient computed on a subset of examples can reasonably approximate the full-data gradient.

    Explanation

    Stochastic gradient descent uses a batch gradient as an approximation to the gradient over the full data set; the approximation need not be exact.

  12. 12

    What is one benefit of the noise introduced by stochastic gradient descent?

    1. A

      It guarantees that every batch gradient equals the full-data gradient.

    2. B

      It ensures that the global minimum is reached in a fixed number of steps.

    3. C

      It removes variance from parameter updates regardless of data balance.

    4. D

      It can act as an implicit regularizer and sometimes help the optimization escape a local minimum.

    Correct answer
    D

    It can act as an implicit regularizer and sometimes help the optimization escape a local minimum.

    Explanation

    The lecture notes that stochasticity can provide implicit regularization and may help optimization move out of local minima, though it does not guarantee a global minimum.

  13. 13

    Why can stochastic-gradient updates be especially unstable when categories are imbalanced?

    1. A

      Rare categories make the loss constant across all parameter values.

    2. B

      Every batch is forced to contain exactly the same number of examples from each category.

    3. C

      Some categories may be absent from several batches and then strongly shift the gradient when they appear.

    4. D

      Imbalance makes the gradient mathematically undefined for all categories.

    Correct answer
    C

    Some categories may be absent from several batches and then strongly shift the gradient when they appear.

    Explanation

    If a category is missing from multiple batches, its later appearance can substantially change the estimated gradient; the lecture relates this instability to how uniformly the data are distributed.

  14. 14

    How does momentum influence a gradient-descent update?

    1. A

      It resets the parameters to their values from the previous training epoch.

    2. B

      It replaces the gradient with the Hessian at the current parameter setting.

    3. C

      It forces the update to move toward the largest loss in the batch.

    4. D

      It biases the current step to continue in the direction of previous updates.

    Correct answer
    D

    It biases the current step to continue in the direction of previous updates.

    Explanation

    Momentum carries information about the direction of past movement, biasing subsequent steps toward continuing in that direction.

  15. 15

    Which statement about the momentum term is supported by the lecture?

    1. A

      Its strength is determined only by the number of training examples, and Adam excludes it.

    2. B

      Its strength is controlled by a hyperparameter, and Adam is a commonly used optimizer with momentum-like behavior.

    3. C

      It is calculated from the Hessian, and Adam uses it only for full-batch training.

    4. D

      It must equal zero for neural networks, and Adam is an example of second-order optimization.

    Correct answer
    B

    Its strength is controlled by a hyperparameter, and Adam is a commonly used optimizer with momentum-like behavior.

    Explanation

    The lecture identifies momentum strength, often denoted α\alphaα, as a hyperparameter and gives Adam as a popular optimizer involving this kind of momentum.

  16. 16

    What can happen when momentum is set too high?

    1. A

      The gradient becomes exactly zero everywhere in the landscape.

    2. B

      The cost becomes convex regardless of the model architecture.

    3. C

      The optimizer is forced to use a batch containing the full data set.

    4. D

      Updates can overshoot the minimum and oscillate, making optimization take longer.

    Correct answer
    D

    Updates can overshoot the minimum and oscillate, making optimization take longer.

    Explanation

    Excessive momentum can cause the parameters to bounce past the minimum and oscillate rather than converge efficiently.

  17. 17

    What makes a simple convex loss landscape comparatively easy to optimize?

    1. A

      It is flat everywhere, so all parameter settings have zero gradient.

    2. B

      It has a single minimum, and gradients point toward it while decreasing near the minimum.

    3. C

      It has an unbounded gradient at its minimum, so every step reaches the optimum.

    4. D

      It has many isolated minima, and gradients point away from each one.

    Correct answer
    B

    It has a single minimum, and gradients point toward it while decreasing near the minimum.

    Explanation

    In the simple convex case described, there is one minimum and gradients guide the parameters toward it, becoming smaller as the minimum is approached.

  18. 18

    Why can a model’s initialization matter greatly on a landscape with multiple local minima?

    1. A

      The gradient is necessarily zero at every possible starting point.

    2. B

      Every starting point is guaranteed to reach the same global minimum.

    3. C

      Initialization determines whether the cost can be evaluated at all.

    4. D

      Different starting points can lead the optimizer to different minima.

    Correct answer
    D

    Different starting points can lead the optimizer to different minima.

    Explanation

    When a landscape has multiple local minima, where optimization begins can affect which minimum it reaches; trying different random seeds can reveal this sensitivity.

  19. 19

    What does PyTorch’s autograd capability imply about a function that is difficult or traditionally considered non-differentiable?

    1. A

      PyTorch guarantees that optimization will find the global minimum of it.

    2. B

      PyTorch makes the function’s gradient nonzero at every point.

    3. C

      PyTorch can provide a defined gradient for it, but that does not ensure the function is easy to optimize.

    4. D

      PyTorch converts every such function into a convex function.

    Correct answer
    C

    PyTorch can provide a defined gradient for it, but that does not ensure the function is easy to optimize.

    Explanation

    Autograd can define or calculate gradients for functions that are not conventionally differentiable, but a defined gradient does not guarantee useful optimization behavior.

  20. 20

    Why can a vanishing-gradient landscape be difficult to optimize?

    1. A

      The gradient becomes infinitely large near the minimum and causes overshooting.

    2. B

      Progress can be very slow, and batch noise may overwhelm the weak gradient signal.

    3. C

      Every parameter receives the same large gradient regardless of the input.

    4. D

      The landscape necessarily has many equally good global minima.

    Correct answer
    B

    Progress can be very slow, and batch noise may overwhelm the weak gradient signal.

    Explanation

    When gradients are very small, updates make little progress, and noise in sampled batches can dominate the weak signal.

  21. 21

    Why is a function with zero gradient everywhere uninformative for gradient-based optimization?

    1. A

      The function cannot be evaluated at any input.

    2. B

      The gradient provides no direction for changing parameters to reduce the loss.

    3. C

      The gradient always points directly toward the global minimum.

    4. D

      The function’s gradient alternates between positive and negative infinity.

    Correct answer
    B

    The gradient provides no direction for changing parameters to reduce the loss.

    Explanation

    A zero gradient everywhere supplies no signal about how parameter changes could lead to a lower-loss region.

  22. 22

    What difficulty is associated with an exploding gradient near a minimum?

    1. A

      Very large gradients can produce unstable updates that overshoot the minimum.

    2. B

      The gradient points toward every local minimum simultaneously.

    3. C

      Very small gradients prevent any update from being calculated.

    4. D

      The cost becomes impossible to evaluate near the minimum.

    Correct answer
    A

    Very large gradients can produce unstable updates that overshoot the minimum.

    Explanation

    If the gradient grows extremely large near the minimizer, updates can become unstable and jump past the minimum.

  23. 23

    How do evolution strategies seek lower-loss parameter settings?

    1. A

      They set all gradients to zero and select the first parameter setting sampled.

    2. B

      They increase the learning rate until the loss becomes independent of the parameters.

    3. C

      They sample small perturbations around current parameters and move toward perturbations with lower loss.

    4. D

      They calculate the exact Hessian and move only along its largest eigenvector.

    Correct answer
    C

    They sample small perturbations around current parameters and move toward perturbations with lower loss.

    Explanation

    Evolution strategies sample perturbations around current parameter values, evaluate their losses, and move toward perturbations that perform better.

  24. 24

    How does gradient clipping address overly large gradients?

    1. A

      It removes the loss function and updates parameters using only the input data.

    2. B

      It replaces every gradient with the full-data average, regardless of its magnitude.

    3. C

      It increases gradients below a threshold until they match the largest gradient.

    4. D

      It limits the gradient magnitude by scaling values that exceed a chosen threshold.

    Correct answer
    D

    It limits the gradient magnitude by scaling values that exceed a chosen threshold.

    Explanation

    Gradient clipping scales back gradients that exceed a specified large value, limiting how far parameters can move in an update.

  25. 25

    In a computational graph, what does a node represent?

    1. A

      A cycle that sends information repeatedly around the graph.

    2. B

      A parameter value that cannot be connected to other computations.

    3. C

      A functional transformation that takes inputs and produces outputs.

    4. D

      A training example that has already received a predicted label.

    Correct answer
    C

    A functional transformation that takes inputs and produces outputs.

    Explanation

    A computational graph represents functional transformations as nodes, connected so their outputs can become inputs to later computations.

  26. 26

    What are the defining properties of a directed acyclic graph (DAG)?

    1. A

      Information follows directed edges, and the graph contains no cycles.

    2. B

      Information flows in both directions along every edge, and cycles are required.

    3. C

      The graph has no edges, and each node computes the same function.

    4. D

      Every node has exactly one input, and all nodes share the same parameters.

    Correct answer
    A

    Information follows directed edges, and the graph contains no cycles.

    Explanation

    Directed means information flows in one direction along an edge; acyclic means the graph has no loops or cycles.

  27. 27

    How can the classroom decision example be understood as a computational graph?

    1. A

      The example forms a cycle in which every decision returns to the initial building.

    2. B

      Each choice transforms the current situation into a new state, such as choosing a building and then stairs or an elevator.

    3. C

      The example represents a single parameter that is updated without using inputs.

    4. D

      Each choice changes the model’s loss without affecting any later decision.

    Correct answer
    B

    Each choice transforms the current situation into a new state, such as choosing a building and then stairs or an elevator.

    Explanation

    The example illustrates a sequence of decisions or transformations, where an earlier choice determines which later actions are available.

  28. 28

    How can a multilayer perceptron be represented as a computational graph?

    1. A

      As a single operation that does not use parameters or intermediate values.

    2. B

      As a collection of independent layers that never pass information between them.

    3. C

      As an undirected cycle in which every layer receives the same output.

    4. D

      As a chain of operations such as linear layers, activation functions, and a final output.

    Correct answer
    D

    As a chain of operations such as linear layers, activation functions, and a final output.

    Explanation

    An MLP can be represented as a chain: inputs pass through a linear layer, an activation, later layers, and eventually an output.

  29. 29

    What happens during the forward pass through a layer with input xxx and parameters θ\thetaθ?

    1. A

      The layer applies its parameterized function to the input to produce an output.

    2. B

      The layer replaces the input with the ground-truth target.

    3. C

      The layer sums gradients from later branches and returns them to earlier inputs.

    4. D

      The layer changes its parameters using the loss before producing an output.

    Correct answer
    A

    The layer applies its parameterized function to the input to produce an output.

    Explanation

    A forward pass maps the input and the layer’s parameters through its function to produce that layer’s output.

  30. 30

    In a multi-layer forward pass, what normally happens to the output of one component?

    1. A

      It is discarded before the next component is evaluated.

    2. B

      It becomes the input to the next component in the graph.

    3. C

      It is treated as the gradient of the final loss.

    4. D

      It replaces the parameters of the next component.

    Correct answer
    B

    It becomes the input to the next component in the graph.

    Explanation

    The output of each component is passed forward as the input to the next component, until the final output and loss are computed.

  31. 31

    If xxx is an n×1n\times1n×1 vector and y=f(x)y=f(x)y=f(x) is a scalar, what is the shape of the derivative of yyy with respect to xxx under the convention described?

    1. A

      An n×1n\times1n×1 column vector.

    2. B

      A scalar.

    3. C

      A 1×n1\times n1×n row vector.

    4. D

      An n×nn\times nn×n matrix.

    Correct answer
    C

    A 1×n1\times n1×n row vector.

    Explanation

    For a scalar output and an n×1n\times1n×1 input vector, the partial derivatives with respect to the input components form a 1×n1\times n1×n row vector.

  32. 32

    If xxx has size n×1n\times1n×1 and y=f(x)y=f(x)y=f(x) has size m×1m\times1m×1, what is the size of the Jacobian ∂y∂x\frac{\partial y}{\partial x}∂x∂y​?

    1. A

      n×mn\times mn×m

    2. B

      n×nn\times nn×n

    3. C

      m×nm\times nm×n

    4. D

      m×mm\times mm×m

    Correct answer
    C

    m×nm\times nm×n

    Explanation

    The Jacobian has one row for each output component and one column for each input component, giving size m×nm\times nm×n.

  33. 33

    If a scalar function depends on a matrix input of size n×mn\times mn×m, what shape does its derivative have under the convention described?

    1. A

      A 1×(nm)1\times(nm)1×(nm) row vector.

    2. B

      An m×nm\times nm×n matrix, transposed relative to the input shape.

    3. C

      An n×mn\times mn×m matrix, identical in shape to the input.

    4. D

      A scalar, because the output is scalar.

    Correct answer
    B

    An m×nm\times nm×n matrix, transposed relative to the input shape.

    Explanation

    The lecture describes the derivative of a scalar with respect to an n×mn\times mn×m matrix as an m×nm\times nm×n matrix, with rows and columns flipped.

  34. 34

    For z=f(u)z=f(u)z=f(u) and u=g(x)u=g(x)u=g(x), with dimensions z:mz:mz:m, u:pu:pu:p, and x:nx:nx:n, which matrix dimensions are used in the chain rule?

    1. A

      ∂z∂x=∂z∂u+∂u∂x\frac{\partial z}{\partial x}=\frac{\partial z}{\partial u}+\frac{\partial u}{\partial x}∂x∂z​=∂u∂z​+∂x∂u​, with shapes (m×p)+(p×n)(m\times p)+(p\times n)(m×p)+(p×n)

    2. B

      ∂z∂x=∂u∂x∂z∂u\frac{\partial z}{\partial x}=\frac{\partial u}{\partial x}\frac{\partial z}{\partial u}∂x∂z​=∂x∂u​∂u∂z​, with shapes (p×n)(m×p)(p\times n)(m\times p)(p×n)(m×p)

    3. C

      ∂z∂x=∂u∂z∂x∂u\frac{\partial z}{\partial x}=\frac{\partial u}{\partial z}\frac{\partial x}{\partial u}∂x∂z​=∂z∂u​∂u∂x​, with shapes (p×m)(n×p)(p\times m)(n\times p)(p×m)(n×p)

    4. D

      ∂z∂x=∂z∂u∂u∂x\frac{\partial z}{\partial x}=\frac{\partial z}{\partial u}\frac{\partial u}{\partial x}∂x∂z​=∂u∂z​∂x∂u​, with shapes (m×p)(p×n)(m\times p)(p\times n)(m×p)(p×n)

    Correct answer
    D

    ∂z∂x=∂z∂u∂u∂x\frac{\partial z}{\partial x}=\frac{\partial z}{\partial u}\frac{\partial u}{\partial x}∂x∂z​=∂u∂z​∂x∂u​, with shapes (m×p)(p×n)(m\times p)(p\times n)(m×p)(p×n)

    Explanation

    The chain rule multiplies the Jacobian from uuu to zzz by the Jacobian from xxx to uuu. Their dimensions (m×p)(m\times p)(m×p) and (p×n)(p\times n)(p×n) yield an (m×n)(m\times n)(m×n) derivative.

  35. 35

    Which description of ReLU’s mathematical properties matches the lecture?

    1. A

      It is nowhere continuous but has a defined gradient at every point.

    2. B

      It is everywhere continuous, almost everywhere differentiable, and not everywhere smooth because of a kink.

    3. C

      It is everywhere smooth but discontinuous at zero.

    4. D

      It is everywhere discontinuous, nowhere differentiable, and smooth at its kink.

    Correct answer
    B

    It is everywhere continuous, almost everywhere differentiable, and not everywhere smooth because of a kink.

    Explanation

    ReLU is continuous everywhere and differentiable almost everywhere, but its kink means it is not everywhere smooth.

  36. 36

    What properties of the Gaussian error linear unit (GeLU) were emphasized?

    1. A

      It is discontinuous, has zero gradient everywhere, and uses the Gaussian probability density.

    2. B

      It is everywhere convex and is guaranteed to optimize better than ReLU.

    3. C

      It is continuous only at zero and is not differentiable anywhere else.

    4. D

      It is everywhere continuous, differentiable, and smooth; it can be written using xΦ(x)x\Phi(x)xΦ(x).

    Correct answer
    D

    It is everywhere continuous, differentiable, and smooth; it can be written using xΦ(x)x\Phi(x)xΦ(x).

    Explanation

    The lecture describes GeLU as xΦ(x)x\Phi(x)xΦ(x), where Φ\PhiΦ is the Gaussian cumulative distribution function, and says it is continuous, differentiable, and smooth everywhere.

  37. 37

    What conclusion did the lecture draw about choosing smoother activation functions such as GeLU over ReLU?

    1. A

      All activation functions must be monotonic, regardless of their other properties.

    2. B

      ReLU cannot be used in differentiable programming because it has a kink.

    3. C

      GeLU is proven to produce a global minimum for every neural network.

    4. D

      Smoothness may make optimization easier, but there is no established guarantee that GeLU is always better.

    Correct answer
    D

    Smoothness may make optimization easier, but there is no established guarantee that GeLU is always better.

    Explanation

    Continuity, differentiability, and smoothness may help optimization, and trends have favored functions with these properties, but the lecture says the optimal choice is not theoretically settled.

  38. 38

    Why is backpropagation more efficient than separately calculating every parameter derivative through the chain rule?

    1. A

      It avoids calculating any derivatives through the network.

    2. B

      It computes the loss only for the first layer of the model.

    3. C

      It reuses shared derivative terms instead of recomputing them for each parameter.

    4. D

      It evaluates the Hessian once and uses it as every parameter gradient.

    Correct answer
    C

    It reuses shared derivative terms instead of recomputing them for each parameter.

    Explanation

    Many chain-rule terms are shared across parameter derivatives. Backpropagation propagates and reuses those terms, making gradient computation practical for large models.

  39. 39

    What is the main direction of information flow during a backward pass?

    1. A

      Parameters travel forward from the loss to replace the model’s inputs.

    2. B

      Gradients or error signals travel from the loss and outputs back toward earlier layers and parameters.

    3. C

      Ground-truth labels travel from the first layer toward the input data.

    4. D

      Training inputs travel from the first layer to the output without any loss calculation.

    Correct answer
    B

    Gradients or error signals travel from the loss and outputs back toward earlier layers and parameters.

    Explanation

    The backward pass propagates the loss-related gradient signal from the output back through the network toward inputs and parameters.

  40. 40

    In the layer notation described, what does LLL represent?

    1. A

      The gradient of a layer’s outputs with respect to its inputs.

    2. B

      The gradient of the total cost with respect to the layer’s activations.

    3. C

      The sum of the losses over all examples in a batch.

    4. D

      The learning rate used to update the layer’s parameters.

    Correct answer
    A

    The gradient of a layer’s outputs with respect to its inputs.

    Explanation

    LLL denotes the derivative of the layer output with respect to the layer input, describing how the output changes as the input changes.

  41. 41

    In the layer notation described, what does ggg represent?

    1. A

      The number of training examples in a batch.

    2. B

      The Hessian of the cost with respect to all parameters.

    3. C

      The gradient of the cost with respect to the activations.

    4. D

      The gradient of the layer output with respect to its input.

    Correct answer
    C

    The gradient of the cost with respect to the activations.

    Explanation

    The lecture uses ggg for the gradient of the cost with respect to a layer’s activations.

  42. 42

    How are a layer’s input gradient and local derivative combined to obtain its parameter-gradient direction?

    1. A

      By multiplying the output cost gradient by the layer’s derivative with respect to its parameters.

    2. B

      By dividing the output gradient by the number of model parameters.

    3. C

      By multiplying the Hessian by the input data and ignoring the output gradient.

    4. D

      By adding the learning rate to the layer’s output.

    Correct answer
    A

    By multiplying the output cost gradient by the layer’s derivative with respect to its parameters.

    Explanation

    The parameter-gradient direction is computed by combining the cost gradient arriving at the layer with the layer’s local derivative with respect to its parameters.

  43. 43

    How is the gradient propagated from a layer’s output back to its input?

    1. A

      The output gradient is multiplied by the layer’s derivative with respect to its input.

    2. B

      The cost is added to the input without using a derivative.

    3. C

      The input is multiplied by the learning rate and sent forward again.

    4. D

      The output gradient is replaced by the layer’s parameter values.

    Correct answer
    A

    The output gradient is multiplied by the layer’s derivative with respect to its input.

    Explanation

    The input gradient is obtained by multiplying the output gradient by the layer’s local derivative with respect to its input.

  44. 44

    Which sequence describes the repeated training procedure for a neural network?

    1. A

      Calculate the loss, freeze all parameters, and repeat the same forward pass.

    2. B

      Update parameters, discard the inputs, calculate a Hessian, and stop.

    3. C

      Propagate gradients forward, replace labels with predictions, and calculate loss once.

    4. D

      Run a forward pass, calculate loss, propagate gradients backward, update parameters, and repeat.

    Correct answer
    D

    Run a forward pass, calculate loss, propagate gradients backward, update parameters, and repeat.

    Explanation

    Training repeatedly computes predictions and loss in a forward pass, sends gradients backward, updates parameters, and performs another pass.

  45. 45

    When the cost for a batch is the average of its examples’ costs, how is its gradient calculated?

    1. A

      As the average of the per-example cost gradients.

    2. B

      As the product of all per-example cost gradients.

    3. C

      As the gradient of only the first example in the batch.

    4. D

      As the largest per-example cost gradient.

    Correct answer
    A

    As the average of the per-example cost gradients.

    Explanation

    Differentiation distributes over the sum, so the gradient of the batch’s average cost is the average of the individual gradients.

  46. 46

    For a linear layer with weight matrix WWW and input column vector xxx, what is the forward output?

    1. A

      y=xWy=xWy=xW

    2. B

      y=WTxy=W^Txy=WTx

    3. C

      y=Wxy=Wxy=Wx

    4. D

      y=W+xy=W+xy=W+x

    Correct answer
    C

    y=Wxy=Wxy=Wx

    Explanation

    A linear layer computes its output by multiplying the weight matrix by the input vector: y=Wxy=Wxy=Wx.

  47. 47

    Using column-vector gradients, how is the gradient propagated through a linear layer with weights WWW?

    1. A

      The input gradient is the transpose of the input vector.

    2. B

      The input gradient is WWW multiplied by the input vector.

    3. C

      The input gradient is WTW^TWT multiplied by the output gradient.

    4. D

      The input gradient is the output gradient divided by WWW.

    Correct answer
    C

    The input gradient is WTW^TWT multiplied by the output gradient.

    Explanation

    For a linear layer y=Wxy=Wxy=Wx, the backward operation multiplies the output gradient by the transposed weight matrix: ∇x=WT∇y\nabla_x= W^T\nabla_y∇x​=WT∇y​.

  48. 48

    For a linear layer y=Wxy=Wxy=Wx, what form does the weight gradient take when the output gradient is a column vector?

    1. A

      The outer product of the output gradient and the transposed input, ∇yxT\nabla_yx^T∇y​xT.

    2. B

      The product of the weight matrix and the input transpose, WxTWx^TWxT.

    3. C

      The outer product of the input and the weight transpose, xWTxW^TxWT.

    4. D

      The sum of the input and output vectors, x+∇yx+\nabla_yx+∇y​.

    Correct answer
    A

    The outer product of the output gradient and the transposed input, ∇yxT\nabla_yx^T∇y​xT.

    Explanation

    Each weight’s derivative is determined by the corresponding output-gradient component and input component, giving the matrix outer product ∇yxT\nabla_yx^T∇y​xT.

  49. 49

    What does the backward operation through a ReLU layer do?

    1. A

      It gates gradients using which activations were active in the forward pass, blocking gradients through inactive units.

    2. B

      It multiplies every gradient by the full weight matrix of the preceding layer.

    3. C

      It applies ReLU again to the parameters and passes every gradient unchanged.

    4. D

      It replaces all negative gradients with positive gradients, regardless of the forward activations.

    Correct answer
    A

    It gates gradients using which activations were active in the forward pass, blocking gradients through inactive units.

    Explanation

    The backward pass uses the forward activations to form a gate that blocks gradients for components that were in ReLU’s zero-output region.

  50. 50

    Why must intermediate activations often be retained during the forward pass?

    1. A

      They are needed only to calculate the model’s learning rate.

    2. B

      The forward pass cannot calculate a final output without storing every training label.

    3. C

      The backward pass may need them to calculate derivatives or gates, such as the ReLU mask.

    4. D

      The optimizer uses them to reconstruct the original training data after each update.

    Correct answer
    C

    The backward pass may need them to calculate derivatives or gates, such as the ReLU mask.

    Explanation

    Backpropagation often uses intermediate values from the forward pass; for ReLU, the activation pattern determines which gradient components pass backward.

  51. 51

    What two operations allow backpropagation to extend from a simple chain to an arbitrary DAG?

    1. A

      Clipping and momentum.

    2. B

      Normalization and random sampling.

    3. C

      Convolution and pooling.

    4. D

      Merging and branching.

    Correct answer
    D

    Merging and branching.

    Explanation

    The lecture identifies merging and branching as the operations needed to extend chain-based backpropagation to arbitrary directed acyclic graphs.

  52. 52

    When multiple inputs are merged, what must backpropagation do?

    1. A

      Send each gradient component back to the input variable to which it corresponds.

    2. B

      Average the input values and send them backward as gradients.

    3. C

      Send the entire merged gradient to only the first input.

    4. D

      Discard the gradients because merged values cannot be differentiated.

    Correct answer
    A

    Send each gradient component back to the input variable to which it corresponds.

    Explanation

    At a merge, gradients must be tracked with respect to the correct input variables and routed back along their corresponding paths.

  53. 53

    When one value branches into multiple paths, how are gradients propagated back through the branch?

    1. A

      The branch is treated as non-differentiable, so no gradient is propagated.

    2. B

      Only the gradient from the path with the highest loss is sent back.

    3. C

      The gradients are multiplied together and sent to separate inputs.

    4. D

      The gradients from the paths are summed and sent back through the shared input.

    Correct answer
    D

    The gradients from the paths are summed and sent back through the shared input.

    Explanation

    A shared input affects each branched path, so the gradients from those paths are summed when propagating back to that input.

  54. 54

    How can backpropagation handle a parameter that is shared across multiple components?

    1. A

      It sums the gradient contributions from the different uses of that parameter.

    2. B

      It assigns a separate copy of the parameter to every use during backpropagation.

    3. C

      It ignores gradients from all but the component with the shortest path.

    4. D

      It updates the parameter using only the first component that uses it.

    Correct answer
    A

    It sums the gradient contributions from the different uses of that parameter.

    Explanation

    Parameter sharing can be viewed as branching; the gradient contributions from the different uses are summed for the shared parameter.

  55. 55

    What is differential programming in the context of the lecture?

    1. A

      A technique that replaces all learned parameters with hand-coded rules.

    2. B

      Programming models as compositions of operations whose behavior can be optimized through differentiation.

    3. C

      A method for evaluating models without inputs, losses, or gradients.

    4. D

      A method of writing code that prohibits the use of neural-network layers.

    Correct answer
    B

    Programming models as compositions of operations whose behavior can be optimized through differentiation.

    Explanation

    Differential programming treats a model as a composition of operations and uses differentiation to optimize its learnable components.

  56. 56

    Why are deep networks described as compositional in the discussion of differential programming?

    1. A

      They can contain only one operation and one parameter.

    2. B

      They can be built from connected functional blocks, such as layers and other reusable components.

    3. C

      They require every component to be trained independently with no connections.

    4. D

      They are composed only of manually written decision rules.

    Correct answer
    B

    They can be built from connected functional blocks, such as layers and other reusable components.

    Explanation

    Deep networks are compositional because they combine functional blocks, such as layers, into larger systems.

  57. 57

    In a partly learned system, what is an example of a component that might be specified by a human rather than learned?

    1. A

      The output category selected by the model for each example.

    2. B

      Every weight matrix in the network after each training batch.

    3. C

      Preprocessing that applies chosen normalization values to natural images.

    4. D

      The gradient of the loss with respect to every input.

    Correct answer
    C

    Preprocessing that applies chosen normalization values to natural images.

    Explanation

    The lecture gives normalization values in image preprocessing as an example of a choice that can be specified directly rather than learned.

  58. 58

    How might a neural module network combine learned and non-learned components?

    1. A

      A parser must learn the image features while the CNN remains unused.

    2. B

      Every component must be a learned CNN with the same parameters.

    3. C

      All components must be explicitly programmed and cannot receive gradients.

    4. D

      A fixed parser can route a question while a learned CNN processes image content.

    Correct answer
    D

    A fixed parser can route a question while a learned CNN processes image content.

    Explanation

    The example describes a parser that may be fixed and a CNN that processes visual content and can receive training updates.

  59. 59

    What is the central idea of the Software 2.0 perspective described in the lecture?

    1. A

      Write every behavior as a fixed rule before seeing any training data.

    2. B

      Define a space of possible systems and optimize within it to obtain a system suited to the task.

    3. C

      Use a single predetermined model that cannot be composed with other modules.

    4. D

      Replace learned systems with programs that cannot be adjusted by data.

    Correct answer
    B

    Define a space of possible systems and optimize within it to obtain a system suited to the task.

    Explanation

    Software 2.0 describes defining a space of possible systems and using optimization, often driven by training examples, to find a suitable system within that space.

  60. 60

    Why can human-programmed constraints in a learning system be helpful or harmful?

    1. A

      They remove the need to choose a cost function.

    2. B

      They guarantee better generalization while making optimization impossible.

    3. C

      They restrict the system’s possibilities, which can help when useful but can impose a poor design when mistaken.

    4. D

      They increase the number of learned parameters without changing the system.

    Correct answer
    C

    They restrict the system’s possibilities, which can help when useful but can impose a poor design when mistaken.

    Explanation

    Human decisions constrain the system. Such constraints may help, but feature-engineering experience shows that human-designed bottlenecks can be worse than learning more of the system from data.

  61. 61

    How does the choice of loss affect a system optimized through differential programming?

    1. A

      It defines the criterion of optimality and therefore influences which system is preferred.

    2. B

      It determines whether the computational graph has directed edges.

    3. C

      It fixes all intermediate activations before the forward pass.

    4. D

      It makes the choice of training data irrelevant.

    Correct answer
    A

    It defines the criterion of optimality and therefore influences which system is preferred.

    Explanation

    The cost or loss specifies what the optimization considers desirable, so its definition affects the resulting optimum.

  62. 62

    How does optimizing model parameters differ from optimizing an input to a fixed model?

    1. A

      Parameter optimization changes the training labels, while input optimization changes the learning rate.

    2. B

      Parameter optimization requires a non-differentiable model, while input optimization requires a convex loss.

    3. C

      Parameter optimization changes the model’s weights, while input optimization changes the data supplied to fixed weights.

    4. D

      Parameter optimization changes only the batch size, while input optimization changes only the output layer.

    Correct answer
    C

    Parameter optimization changes the model’s weights, while input optimization changes the data supplied to fixed weights.

    Explanation

    The lecture contrasts changing model parameters with holding the model fixed and changing its input, such as image pixels or a generator’s latent input.

  63. 63

    Why can optimizing class probabilities after a softmax behave differently from optimizing pre-softmax logits?

    1. A

      Softmax probabilities cannot be differentiated, while logits are always constant.

    2. B

      Softmax probabilities are independent of the logits, while logits depend on the input labels.

    3. C

      Optimizing logits guarantees a global minimum, while optimizing probabilities cannot calculate gradients.

    4. D

      Increasing one probability may be easiest by making alternatives unlikely, while optimizing logits can be more stable.

    Correct answer
    D

    Increasing one probability may be easiest by making alternatives unlikely, while optimizing logits can be more stable.

    Explanation

    The lecture notes that maximizing a class’s softmax probability can be achieved by making alternatives unlikely; optimizing pre-softmax logits tends to be more stable.

  64. 64

    What does feature visualization do when used to inspect a trained neural network?

    1. A

      It changes the model’s labels until all predictions match the training set.

    2. B

      It replaces every learned weight with an image pixel.

    3. C

      It calculates the Hessian without using the model’s activations.

    4. D

      It optimizes an input to reveal what the model or a particular neuron responds to.

    Correct answer
    D

    It optimizes an input to reveal what the model or a particular neuron responds to.

    Explanation

    Feature visualization optimizes inputs, for example to maximize a class output or a neuron’s activation, to probe what the trained model represents.

  65. 65

    What does a DeepDream-style visualization illustrate?

    1. A

      An input can be optimized to strongly activate features in a trained model, revealing patterns the model responds to.

    2. B

      A fixed model cannot be used to optimize its input.

    3. C

      A neural network can produce images only if its loss landscape is convex.

    4. D

      A model’s parameters can be changed only by adding random noise to its labels.

    Correct answer
    A

    An input can be optimized to strongly activate features in a trained model, revealing patterns the model responds to.

    Explanation

    DeepDream-style methods optimize inputs to increase model activations, creating visualizations of patterns the model has learned to respond to.

  66. 66

    What is the purpose of a joint embedding space in the CLIP example?

    1. A

      To make the image encoder generate text and the text encoder generate pixels.

    2. B

      To store text labels separately from images so their similarity cannot be evaluated.

    3. C

      To place semantically corresponding text and images close together in a shared representation space.

    4. D

      To ensure that every image and text description has an identical input representation.

    Correct answer
    C

    To place semantically corresponding text and images close together in a shared representation space.

    Explanation

    The example describes text and image encoders that map semantically corresponding inputs to nearby points in a shared embedding space.

  67. 67

    In the described combination of a fixed CLIP model and a fixed image generator, what is optimized to match an image to a text prompt?

    1. A

      The CLIP training labels, while all inputs remain fixed.

    2. B

      The text encoder’s parameters, while the image generator is removed.

    3. C

      The learning rate of every encoder and generator layer.

    4. D

      The generator’s input or latent value, while the trained model parameters remain fixed.

    Correct answer
    D

    The generator’s input or latent value, while the trained model parameters remain fixed.

    Explanation

    The encoders and generator can be held fixed while the generator’s input is optimized so its resulting image is close to the text prompt in CLIP’s representation space.

  68. 68

    What is an embedding or representation in the usage described in the lecture?

    1. A

      The original input copied without transformation into every layer.

    2. B

      A scalar loss that measures the error on one training example.

    3. C

      A lower-dimensional representation produced by a network from a complex or high-dimensional input.

    4. D

      A parameter update that changes the learning rate after a batch.

    Correct answer
    C

    A lower-dimensional representation produced by a network from a complex or high-dimensional input.

    Explanation

    An encoder maps a complex or high-dimensional input, such as an image, into a lower-dimensional representation, often a vector.

  69. 69

    How does modularity make it possible to reuse previously trained models in a new system?

    1. A

      A trained component must be retrained from scratch before it can connect to another model.

    2. B

      A trained component prevents gradients from being calculated anywhere in the new system.

    3. C

      A previously trained component can be reused only if it has no parameters.

    4. D

      A trained component can be treated as fixed and connected to other components, while other inputs or modules are optimized.

    Correct answer
    D

    A trained component can be treated as fixed and connected to other components, while other inputs or modules are optimized.

    Explanation

    Previously trained modules can be frozen and plugged into a larger system; optimization can then focus on other components or inputs as appropriate.

Question 1 of 69
Question 1 of 69

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent