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

  • 72Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Training Basics
During training, a neural network adjusts its parameters to make its predictions closer to the
for each input.

72 questions

  1. 1
    During training, a neural network adjusts its parameters to make its predictions closer to the
    _____
    for each input.
    Hint

    This is the target value or label the model is meant to predict.

    Answer

    ground truth

    Explanation

    The ground truth provides the desired prediction for an input, and the loss measures the difference between it and the model's prediction.

  2. 2
    The numerical values associated with a network's layers that are learned during training are its
    _____
    .
    Hint

    These are the values that training repeatedly adjusts.

    Answer

    parameters

    Explanation

    A neural network learns its parameters by changing their values to reduce the loss on available data.

  3. 3
    A function that measures the difference between a model's prediction and the ground truth is a
    _____
    .
    Hint

    It gives a measure of prediction error for an example.

    Answer

    loss

    Explanation

    The loss is calculated from the difference between the model's prediction and the desired ground truth.

  4. 4
    In the lecture's terminology, the overall cost can be calculated as the
    _____
    of individual losses across the training data.
    Hint

    Think of combining each example's loss by adding them together.

    Answer

    sum

    Explanation

    The cost function was described as the sum of the losses over the data points in the training set.

  5. 5
    The goal of parameter optimization is to find the parameter values that
    _____
    the cost function.
    Hint

    Optimization seeks a lower value of the objective being measured.

    Answer

    minimize

    Explanation

    Training searches for parameters that minimize the cost over the available data.

  6. 6
    Evaluating the gradient at a point gives first-order information about how the objective changes; this is called
    _____
    optimization.
    Hint

    It uses the local linear approximation rather than curvature information.

    Answer

    first order

    Explanation

    First-order optimization relies on the gradient, which gives a local linear approximation to change in the objective.

  7. 7
    The matrix of second derivatives used in second-order optimization is the
    _____
    .
    Hint

    It describes curvature through second derivatives.

    Answer

    Hessian

    Explanation

    The Hessian contains second-order derivative information, though the lecture notes that it is not often calculated in practice.

  8. 8
    In gradient descent, the gradient indicates a direction of steepest increase, so parameters are updated toward the
    _____
    direction.
    Hint

    The update should reduce the loss rather than increase it.

    Answer

    downward

    Explanation

    Gradient descent moves downhill on the loss landscape to seek a minimum.

  9. 9
    A complete pass of training data used in a parameter update is called an
    _____
    .
    Hint

    This term describes processing the full training set once.

    Answer

    epoch

    Explanation

    An epoch is one complete pass through the training data; training typically repeats updates over multiple passes.

  10. 10
    A separate set used to monitor whether training progress has plateaued can be a
    _____
    set.
    Hint

    It is used to assess progress during training rather than to fit the parameters directly.

    Answer

    validation

    Explanation

    A validation set can help identify when performance stops improving and training may be finished.

  11. 11
    Computing a gradient using only a subset of the training examples is the central approximation in
    _____
    .
    Hint

    This method uses sampled data rather than the entire dataset for each gradient calculation.

    Answer

    stochastic gradient descent

    Explanation

    Stochastic gradient descent estimates the full-data gradient using a subset of examples.

  12. 12
    The subset of examples used to calculate a stochastic gradient is called a
    _____
    .
    Hint

    Its size controls how many examples contribute to an update.

    Answer

    batch

    Explanation

    A batch is the subset of data used to compute a gradient for an update.

  13. 13
    When a batch contains one example, parameters are updated after each individual
    _____
    .
    Hint

    A batch size of one contains a single data point.

    Answer

    example

    Explanation

    With batch size one, each example is processed and followed by a parameter update.

  14. 14
    When the batch size equals the full training dataset, stochastic gradient descent becomes standard
    _____
    descent.
    Hint

    This approach uses all examples to calculate each update.

    Answer

    gradient

    Explanation

    Using the entire dataset for each gradient calculation is standard gradient descent.

  15. 15
    A practical reason to use batches instead of the entire dataset is that full-dataset updates may be too slow or too demanding in
    _____
    .
    Hint

    Consider the time and resources needed to process very large datasets.

    Answer

    computational complexity

    Explanation

    Large datasets can make full-gradient calculations computationally intractable or difficult to fit in GPU memory.

  16. 16
    Because a batch samples only part of the data, its gradient may differ from the gradient over the full dataset; this creates gradient
    _____
    .
    Hint

    The direction can fluctuate between different batches.

    Answer

    variance

    Explanation

    Batch gradients are not guaranteed to match the full-data gradient, so stochastic updates can have high variance.

  17. 17
    When categories are unevenly represented, some may be absent from several batches, making gradient updates less
    _____
    .
    Hint

    The issue is that the update direction can shift sharply when a rare category appears.

    Answer

    stable

    Explanation

    Imbalanced data can make batch gradients unstable because categories may appear inconsistently across batches.

  18. 18
    One benefit of stochastic gradient descent is that noise in its updates can act as an implicit
    _____
    .
    Hint

    This effect can discourage overly narrow solutions and help generalization.

    Answer

    regularizer

    Explanation

    The lecture describes the noise in stochastic gradient descent as an implicit regularizer.

  19. 19
    The hyperparameter that controls how strongly an update continues in the direction of earlier updates is the
    _____
    term.
    Hint

    It is analogous to a moving object gaining speed as it rolls downhill.

    Answer

    momentum

    Explanation

    Momentum biases gradient steps toward the direction of previous updates, with its strength controlled by a hyperparameter.

  20. 20
    If momentum is too high, updates can overshoot a minimum and produce
    _____
    around it.
    Hint

    The parameters repeatedly bounce back and forth instead of settling efficiently.

    Answer

    oscillation

    Explanation

    Excessive momentum can cause the updates to pass the minimum repeatedly, creating oscillation and slowing optimization.

  21. 21
    A loss landscape with a single minimum and gradients that point toward it from everywhere is
    _____
    .
    Hint

    This landscape has no competing local minima.

    Answer

    convex

    Explanation

    In the convex case described, there is a single minimum and gradients lead toward it.

  22. 22
    When optimization reaches a minimum that is not the lowest value in the entire landscape, it has found a
    _____
    minimum.
    Hint

    This minimum is best only within a nearby region.

    Answer

    local

    Explanation

    A non-convex landscape may have multiple minima, so gradient descent can settle at a local rather than global minimum.

  23. 23
    On a landscape with multiple local minima, the final solution can depend strongly on where the parameters are
    _____
    .
    Hint

    Different starting points can lead optimization into different basins.

    Answer

    initialized

    Explanation

    Initialization matters when a non-convex loss landscape has multiple local minima.

  24. 24
    A gradient that becomes extremely small across a region creates a
    _____
    gradient problem.
    Hint

    With little gradient signal, progress can become very slow.

    Answer

    vanishing

    Explanation

    Vanishing gradients provide little signal for optimization, so progress can be slow and batch noise may dominate.

  25. 25
    If the gradient is zero everywhere on a flat landscape, it provides no useful
    _____
    about how to reduce the loss.
    Hint

    The optimizer has no directional information from the gradient.

    Answer

    signal

    Explanation

    A zero gradient across a flat landscape is uninformative about how to make progress toward a low-loss region.

  26. 26
    When gradients grow extremely large near a minimum, the resulting problem is called an
    _____
    gradient.
    Hint

    Updates may become unstable and jump too far.

    Answer

    exploding

    Explanation

    Exploding gradients can cause very large, unstable updates that overshoot the minimum.

  27. 27
    A function can be differentiable in PyTorch yet still be difficult to optimize if its gradient is
    _____
    .
    Hint

    Autograd can calculate a derivative that supplies no useful direction.

    Answer

    zero

    Explanation

    PyTorch autograd can calculate gradients for many functions, but a zero gradient does not give the optimizer a useful path toward a minimum.

  28. 28
    At a discontinuity, PyTorch autograd can still define gradients using assumptions such as
    _____
    derivatives.
    Hint

    These derivatives describe change along a specified direction.

    Answer

    directional

    Explanation

    The lecture notes that PyTorch can calculate derivatives around discontinuities using directional derivatives, even when optimization may remain difficult.

  29. 29
    A way to assess how sensitive results are to initialization is to compare performance across different random
    _____
    .
    Hint

    Each one can produce a different starting point for training.

    Answer

    seeds

    Explanation

    Variation in performance across random seeds can indicate instability in the loss landscape.

  30. 30
    Evolution strategies search locally by sampling small
    _____
    around current parameter values.
    Hint

    These are small changes used to explore nearby parameter settings.

    Answer

    perturbations

    Explanation

    Evolution strategies sample perturbations around current parameters and move toward those that achieve lower loss.

  31. 31
    In an evolution strategy, the sampled parameter changes are evaluated by comparing their resulting
    _____
    .
    Hint

    The method prefers perturbations that improve the objective.

    Answer

    loss

    Explanation

    Evolution strategies select perturbations that result in lower loss, providing locally loss-minimizing directions.

  32. 32
    Gradient clipping limits the size of an update when the gradient exceeds a chosen
    _____
    .
    Hint

    The gradient is scaled back rather than allowed to grow without bound.

    Answer

    value

    Explanation

    Gradient clipping scales gradients that exceed a specified maximum, helping prevent excessively large updates.

  33. 33
    Gradient clipping can help prevent updates from moving too far and
    _____
    across a sharp region of the loss landscape.
    Hint

    The parameters might otherwise jump back and forth over a minimum.

    Answer

    oscillating

    Explanation

    By limiting update size, gradient clipping can reduce overshooting and oscillation in sharp loss landscapes.

  34. 34
    A commonly used activation function that is continuous everywhere and differentiable almost everywhere, but not smooth everywhere, is
    _____
    .
    Hint

    Its graph has a kink where its behavior changes.

    Answer

    ReLU

    Explanation

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

  35. 35
    The activation function formed using the Gaussian cumulative distribution function and discussed as a smooth alternative is
    _____
    .
    Hint

    Its name expands to Gaussian error linear unit.

    Answer

    GeLU

    Explanation

    GeLU uses the Gaussian cumulative distribution function and is everywhere continuous, differentiable, and smooth.

  36. 36
    The three loss-landscape properties that the lecture says trends increasingly favor are continuity, differentiability, and
    _____
    .
    Hint

    This property rules out abrupt changes in the derivative.

    Answer

    smoothness

    Explanation

    The properties discussed are being everywhere continuous, everywhere differentiable, and everywhere smooth.

  37. 37
    A computational graph represents functional transformations as nodes connected by
    _____
    .
    Hint

    They show how information moves between operations.

    Answer

    edges

    Explanation

    Each node represents a functional transformation, while edges carry information between transformations.

  38. 38
    A deep-learning computation graph is commonly a directed acyclic graph, abbreviated
    _____
    .
    Hint

    The abbreviation names a graph that is directed and has no cycles.

    Answer

    DAG

    Explanation

    Deep learning primarily uses directed acyclic graphs, or DAGs.

  39. 39
    In a directed graph, information on an edge is assumed to travel in
    _____
    direction.
    Hint

    The edges are not treated as carrying information both ways.

    Answer

    one

    Explanation

    Directed means that information flows in only one direction along a given edge.

  40. 40
    Acyclic means that a graph contains no loops or
    _____
    .
    Hint

    The term rules out paths that return to an earlier node.

    Answer

    cycles

    Explanation

    An acyclic graph has no cycles or loops.

  41. 41
    A layer or neural network can serve as a
    _____
    in a computation graph.
    Hint

    It is one functional transformation within the larger graph.

    Answer

    node

    Explanation

    A computation graph can represent layers or whole networks as functional transformation nodes.

  42. 42
    In a forward pass, a component maps its inputs and parameters to its
    _____
    .
    Hint

    These values are passed onward to later components.

    Answer

    outputs

    Explanation

    A forward pass applies a functional transformation to inputs and parameters to produce outputs.

  43. 43
    Because each layer is differentiable with respect to its inputs, gradients can be propagated through the
    _____
    .
    Hint

    This is the full sequence or graph of connected components.

    Answer

    network

    Explanation

    Differentiable layers make it possible to compute gradients with respect to parameters throughout the network.

  44. 44
    For a vector-valued output, the matrix of partial derivatives of output components with respect to input components is the
    _____
    .
    Hint

    It organizes many first derivatives into a matrix.

    Answer

    Jacobian

    Explanation

    The Jacobian contains the partial derivatives of each output component with respect to each input component.

  45. 45
    The chain rule computes a derivative through a composition by multiplying the relevant
    _____
    derivatives.
    Hint

    Each local derivative describes one step in the composed function.

    Answer

    partial

    Explanation

    The chain rule factors the derivative of a composition into products of derivatives for its component transformations.

  46. 46
    Backpropagation reuses shared derivative terms so they do not need to be computed separately for every
    _____
    .
    Hint

    The efficiency benefit applies to the many model values being learned.

    Answer

    parameter

    Explanation

    Backpropagation efficiently propagates shared terms through the computation graph instead of separately recomputing every derivative.

  47. 47
    During the backward pass, gradients carry an error
    _____
    from the outputs and loss toward earlier layers.
    Hint

    It communicates how the cost changes as information moves backward.

    Answer

    signal

    Explanation

    The backward pass propagates the gradient or error signal from the output and loss back toward inputs and parameters.

  48. 48
    For a layer, the gradient of its outputs with respect to its inputs describes how the layer's outputs change with its
    _____
    .
    Hint

    It is a local derivative of the layer transformation.

    Answer

    inputs

    Explanation

    The layer derivative with respect to its inputs captures how the outputs respond to changes in those inputs.

  49. 49
    The gradient of the cost with respect to a layer's activations indicates how the cost changes with those
    _____
    .
    Hint

    This is the quantity propagated backward through the layer.

    Answer

    activations

    Explanation

    The activation gradient records the cost's partial derivatives with respect to the layer activations.

  50. 50
    A layer's input gradient is computed by multiplying its output gradient by the layer's local
    _____
    .
    Hint

    The chain rule combines the incoming gradient with this local quantity.

    Answer

    derivative

    Explanation

    Backpropagation computes the input gradient iteratively by combining the output gradient with the layer derivative.

  51. 51
    The standard neural-network training cycle is forward pass, backward pass, parameter update, and
    _____
    .
    Hint

    The cycle continues until training meets a stopping criterion.

    Answer

    repeat

    Explanation

    Training repeatedly computes outputs and loss, propagates gradients backward, updates parameters, and runs the process again.

  52. 52
    For a batch, the gradient of the average cost is the average of the gradients of the per-data-point
    _____
    .
    Hint

    Each example contributes its own objective value and gradient.

    Answer

    costs

    Explanation

    The derivative can move inside the sum, so the batch gradient is obtained by averaging individual per-example cost gradients.

  53. 53
    Backpropagation requires storing intermediate layer representations so they can be used during the
    _____
    pass.
    Hint

    The saved values are needed after the forward computation has completed.

    Answer

    backward

    Explanation

    Intermediate representations or activations must be kept in memory to efficiently calculate backpropagation.

  54. 54
    In a linear layer, the forward output is calculated by multiplying the weight matrix by the
    _____
    .
    Hint

    This vector is transformed by the layer's weights.

    Answer

    input

    Explanation

    For a linear layer, the output is the weights multiplied by the input.

  55. 55
    For a linear layer, the backward input gradient is calculated by multiplying the output gradient by the
    _____
    .
    Hint

    The same layer matrix used in the forward operation is involved.

    Answer

    weights

    Explanation

    The input gradient is obtained by multiplying the output gradient by the layer weights, with the appropriate matrix orientation.

  56. 56
    In a linear layer, the weight update direction is formed from the layer input and the
    _____
    gradient.
    Hint

    This is the gradient arriving from the next part of the network.

    Answer

    output

    Explanation

    The weight update direction is calculated by multiplying the input by the output gradient.

  57. 57
    The learning rate scales the parameter update direction before that change is applied to the
    _____
    .
    Hint

    These are the learned values changed by the update.

    Answer

    weights

    Explanation

    The update direction is multiplied by the learning rate and applied to the weights.

  58. 58
    A multilayer perceptron can be represented as connected linear layers and an
    _____
    function.
    Hint

    ReLU is one example of this kind of function.

    Answer

    activation

    Explanation

    An MLP combines linear transformations with activation functions, followed by an output and loss calculation.

  59. 59
    On the backward pass through a ReLU, a gating operation masks gradients for components that were in the
    _____
    part of the ReLU.
    Hint

    Those components were inactive during the forward pass.

    Answer

    zero

    Explanation

    The backward operation gates gradients so that components corresponding to the zero part of ReLU do not pass gradients onward.

  60. 60
    In the transposed-vector convention described for an MLP, the backward operation for a linear layer uses the weights
    _____
    .
    Hint

    The matrix orientation is reversed compared with the forward operation.

    Answer

    transposed

    Explanation

    With gradients treated as column vectors, the backward operation for a linear layer is the forward operation using transposed weights.

  61. 61
    A first-order approximation of a complex loss landscape is a
    _____
    .
    Hint

    It is the linear surface used to approximate local behavior.

    Answer

    plane

    Explanation

    The lecture explains that first-order gradient optimization fits a plane to the local loss landscape and moves along its direction.

  62. 62
    To backpropagate through a merge, each path must receive the gradient corresponding to its own
    _____
    variables.
    Hint

    The merge combines information from multiple sources, which must remain distinguishable in the backward pass.

    Answer

    input

    Explanation

    At a merge, gradients are propagated with respect to the correct input variables on each contributing path.

  63. 63
    When information branches into multiple paths, the gradients from those paths are
    _____
    before being sent back through the shared input.
    Hint

    The contributions from every branch are aggregated.

    Answer

    summed

    Explanation

    Backpropagation through a branching operation adds the gradients from the different paths.

  64. 64
    When parameters are shared across several components, their gradient contributions are handled like a
    _____
    in the graph.
    Hint

    The shared parameters affect multiple downstream paths.

    Answer

    branch

    Explanation

    Parameter sharing can be viewed as branching, so gradients from the paths using those parameters are summed.

  65. 65
    Differential programming treats a model as a program whose components can be differentiated and optimized with respect to a scalar
    _____
    .
    Hint

    This is the objective used to evaluate how well the system performs.

    Answer

    cost

    Explanation

    Differential programming enables optimization of nodes or edges with respect to a scalar cost.

  66. 66
    PyTorch, TensorFlow, and JAX are libraries that enable efficient
    _____
    programming.
    Hint

    The programming approach combines model computation with differentiation.

    Answer

    differential

    Explanation

    These libraries support differential programming by providing tools for constructing computations and calculating gradients.

  67. 67
    A model component that is fixed by a human rather than learned from training data is
    _____
    .
    Hint

    It is explicitly specified instead of being adjusted through backpropagation.

    Answer

    programmed

    Explanation

    Differential programs may combine components explicitly programmed by a human with components learned through backpropagation.

  68. 68
    Normalizing natural images with chosen values during preprocessing is an example of an explicitly programmed component that is not necessarily
    _____
    .
    Hint

    The values can be set directly rather than estimated by training.

    Answer

    learned

    Explanation

    The lecture uses image normalization as an example of a preprocessing choice defined directly rather than learned.

  69. 69
    A neural-network encoder maps complex, high-dimensional input into a lower-dimensional
    _____
    .
    Hint

    This compact representation may be a vector.

    Answer

    embedding

    Explanation

    An encoder produces a low-dimensional representation, often called an embedding, of its input data.

  70. 70
    To optimize model inputs rather than model parameters, training can update the input while keeping the model parameters
    _____
    .
    Hint

    The model is held constant as the input is adjusted.

    Answer

    fixed

    Explanation

    Input optimization changes the input to increase or decrease a model output while the parameters remain fixed.

  71. 71
    Feature visualization can probe a trained model by optimizing an input to maximize the activation of a particular
    _____
    .
    Hint

    The target can be specified by its location in a layer.

    Answer

    neuron

    Explanation

    Optimizing an input to maximize a neuron's value reveals patterns that the model associates with that neuron.

  72. 72
    In the CLIP and image-generation example, the optimized hidden value is the
    _____
    to the image generator.
    Hint

    The pretrained model parameters remain fixed while this value is adjusted.

    Answer

    input

    Explanation

    The image generator and CLIP encoders can be fixed while optimizing the input that produces an image most aligned with a text prompt.

1 of 72
Question 1 of 72

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent