1. Home
  2. Explore
  3. Computer Science
  4. Deep Learning with PyTorch

Study methods

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

Deep Learning with PyTorch

  • 129Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Deep Learning Foundations
Deep learning is a subset of
that uses layered models to learn patterns.

129 questions

  1. 1
    Deep learning is a subset of
    _____
    that uses layered models to learn patterns.
    Hint

    Think of the broader field that includes many types of predictive models.

    Answer

    machine learning

  2. 2
    A basic neural network is organized into input, hidden, and
    _____
    layers.
    Hint

    This layer contains the model's predictions.

    Answer

    output

  3. 3
    The original brain-inspired intuition for neural networks was based on interconnected cells called
    _____
    .
    Hint

    These cells are the basic units of the nervous system.

    Answer

    neurons

  4. 4
    Because layered models need substantial data to derive patterns, deep learning tasks often involve at least
    _____
    data points.
    Hint

    The content describes a data requirement much larger than a few thousand examples.

    Answer

    hundreds of thousands

  5. 5
    The popular framework used throughout the course to implement deep learning algorithms is
    _____
    .
    Hint

    It is a well-maintained framework with a Python-friendly interface.

    Answer

    PyTorch

  6. 6
    The fundamental data structure in PyTorch, similar to an array or matrix, is a
    _____
    .
    Hint

    Neural network computations in PyTorch are built around this multidimensional structure.

    Answer

    tensor

  7. 7
    PyTorch tensors can be created from Python lists or
    _____
    .
    Hint

    These are array objects from a widely used Python numerical library.

    Answer

    NumPy arrays

  8. 8
    In PyTorch, a tensor's dimensions can be inspected using its
    _____
    attribute.
    Hint

    This property reveals the size along each dimension.

    Answer

    shape

  9. 9
    A tensor's
    _____
    identifies the kind of values it stores, such as 64-bit integers.
    Hint

    This property distinguishes integer values from floating-point values.

    Answer

    data type

  10. 10
    Two tensors can be added or subtracted element by element when their
    _____
    match exactly.
    Hint

    Their dimensions must align.

    Answer

    shapes

  11. 11
    In matrix multiplication, each result is calculated by multiplying a row of the first matrix by a
    _____
    of the second matrix and summing the products.
    Hint

    The row is paired with a vertical set of values from the second matrix.

    Answer

    column

  12. 12
    A neural network's input neurons correspond to the dataset's
    _____
    , while its output neurons correspond to the classes or values being predicted.
    Hint

    These are the input variables describing each example.

    Answer

    features

  13. 13
    A network in which every input neuron connects to every output neuron is called a
    _____
    network.
    Hint

    Every neuron in one layer links to all neurons in the adjacent layer.

    Answer

    fully connected

  14. 14
    A network with no hidden layers and a single linear output layer is equivalent to a
    _____
    model.
    Hint

    It represents a direct linear relationship between inputs and outputs.

    Answer

    linear

  15. 15
    The PyTorch module commonly imported as nn provides concise and flexible components for building
    _____
    .
    Hint

    It includes layers and containers used to define models.

    Answer

    neural networks

  16. 16
    The learned quantities that determine how strongly input features affect a linear neuron are its
    _____
    .
    Hint

    A feature with greater influence has a larger value of this learned quantity.

    Answer

    weights

  17. 17
    A neuron's additional term, independent of its feature weights, that provides a baseline output is the
    _____
    .
    Hint

    It shifts the neuron's output independently of the weighted inputs.

    Answer

    bias

  18. 18
    PyTorch's nn.Sequential container passes input through its layers
    _____
    .
    Hint

    Each layer's output becomes the next layer's input.

    Answer

    in sequence

  19. 19
    For adjacent linear layers to connect properly, the input dimension of each layer must match the
    _____
    dimension of the preceding layer.
    Hint

    The number of values produced by one layer must be accepted by the next.

    Answer

    output

  20. 20
    Each neuron with eight input weights and one bias has
    _____
    learnable parameters.
    Hint

    Count the weights and add the bias.

    Answer

    nine

  21. 21
    A two-layer model with 36 parameters in its first layer and 10 in its second has
    _____
    learnable parameters in total.
    Hint

    Add the parameter counts of both layers.

    Answer

    46

  22. 22
    A model's ability to handle more complex datasets, which tends to increase as it gains parameters, is its model
    _____
    .
    Hint

    This describes how much complexity a model can represent.

    Answer

    capacity

  23. 23
    Adding non-linear activation functions allows a network to learn interactions beyond simple
    _____
    relationships.
    Hint

    These are the relationships a network made only of linear layers is limited to modeling.

    Answer

    linear

  24. 24
    For binary classification, the sigmoid function transforms an output into a value between
    _____
    and 1.
    Hint

    The output is bounded by the endpoints of the probability range.

    Answer

    0

  25. 25
    With a 0.5 threshold, a sigmoid probability greater than 0.5 is assigned to
    _____
    .
    Hint

    This is the positive class in the binary example.

    Answer

    class one

  26. 26
    For multiclass classification, softmax produces probabilities that sum to
    _____
    .
    Hint

    The outputs form a probability distribution.

    Answer

    one

  27. 27
    In a multiclass prediction, the selected class is the one with the
    _____
    probability.
    Hint

    Choose the class with the largest output score after probabilities are calculated.

    Answer

    highest

  28. 28
    The process of passing input data forward through network layers to produce predictions is called a
    _____
    pass.
    Hint

    It moves data from the input toward the output.

    Answer

    forward

  29. 29
    A regression network predicting continuous values can use a final linear layer with
    _____
    activation function.
    Hint

    Unlike classification, the output need not be restricted to a probability range.

    Answer

    no

  30. 30
    A loss function compares a model prediction with the
    _____
    label to measure prediction error.
    Hint

    This is the known target against which the prediction is evaluated.

    Answer

    true

  31. 31
    The training objective is to
    _____
    the loss value.
    Hint

    The model should make its predictions closer to the ground truth.

    Answer

    minimize

  32. 32
    For classification, the commonly used loss function that takes raw class scores and encoded targets is
    _____
    loss.
    Hint

    It is the standard classification loss highlighted in the content.

    Answer

    cross entropy

  33. 33
    In one-hot encoding, the true class is represented by a 1 while all other class positions contain
    _____
    .
    Hint

    All non-target entries are set to this value.

    Answer

    zeros

  34. 34
    For three classes, the one-hot encoding of class zero is
    _____
    .
    Hint

    Place the 1 in the first of three positions.

    Answer

    100

  35. 35
    The slope of a loss function with respect to a parameter is represented by its
    _____
    .
    Hint

    It indicates how steeply the function rises or falls.

    Answer

    derivative

  36. 36
    During backpropagation, derivatives of the loss with respect to model parameters are called
    _____
    .
    Hint

    These values guide parameter updates.

    Answer

    gradients

  37. 37
    A point where the slope of the loss function is flat and its derivative is zero is a
    _____
    .
    Hint

    It is a low point in the function that training aims to reach.

    Answer

    minimum

  38. 38
    A non-convex loss function can have multiple
    _____
    minima, each lower than nearby points but not necessarily the lowest overall.
    Hint

    These minima are confined to a neighborhood rather than being globally lowest.

    Answer

    local

  39. 39
    The backward pass that calculates gradients and propagates them through a network is called
    _____
    .
    Hint

    It is the process that follows the forward pass to compute parameter gradients.

    Answer

    backpropagation

  40. 40
    In PyTorch, calling backward on the loss stores parameter gradients in each parameter's
    _____
    attribute.
    Hint

    This attribute holds the calculated gradient.

    Answer

    grad

  41. 41
    The optimizer updates model parameters by taking steps guided by their loss gradients, a method known as gradient
    _____
    .
    Hint

    The method moves parameters in a direction intended to reduce the loss.

    Answer

    descent

  42. 42
    The tunable value that controls the size of parameter updates is the
    _____
    rate.
    Hint

    It determines how large a step the optimizer takes.

    Answer

    learning

  43. 43
    Stochastic gradient descent is commonly abbreviated
    _____
    .
    Hint

    The abbreviation combines the initial letters of the optimizer's name.

    Answer

    SGD

  44. 44
    The optimizer's step operation applies calculated gradients to
    _____
    model parameters.
    Hint

    It changes parameter values based on the optimizer's rule.

    Answer

    update

  45. 45
    A learning rate that is too high can cause an optimizer to
    _____
    around the minimum instead of settling near it.
    Hint

    The steps overshoot on alternating sides of the low point.

    Answer

    bounce

  46. 46
    Momentum helps an optimizer move past local minima by maintaining larger steps when recent steps were also
    _____
    .
    Hint

    It carries forward the effect of previous update sizes.

    Answer

    large

  47. 47
    In a training loop, gradients are typically set to zero before processing a new batch because the optimizer otherwise retains gradients from
    _____
    steps.
    Hint

    These are gradients from earlier batches.

    Answer

    previous

  48. 48
    For regression, mean squared error is the mean of the
    _____
    differences between predictions and ground truth.
    Hint

    The error is multiplied by itself before averaging.

    Answer

    squared

  49. 49
    A dataset that is fully passed through once during training completes one
    _____
    .
    Hint

    Training commonly repeats this full-data cycle multiple times.

    Answer

    epoch

  50. 50
    The number of samples processed together in one data-loader iteration is the
    _____
    size.
    Hint

    It controls how many examples are grouped for each iteration.

    Answer

    batch

  51. 51
    Randomizing sample order during training with the data loader's shuffle option can improve model
    _____
    .
    Hint

    This is the ability to perform well on unseen data.

    Answer

    generalization

  52. 52
    Training data adjusts model parameters, validation data helps tune hyperparameters, and test data evaluates the model's
    _____
    performance.
    Hint

    This evaluation is made after model development and tuning.

    Answer

    final

  53. 53
    For a regression target that is continuous, a suitable loss function is
    _____
    loss.
    Hint

    It averages the squared differences between predictions and targets.

    Answer

    mean squared error

  54. 54
    Training loss is averaged across batches by dividing the accumulated loss by the number of
    _____
    .
    Hint

    This count is the denominator when computing mean loss for an epoch.

    Answer

    batches

  55. 55
    When training loss keeps decreasing while validation loss starts rising, the model is likely
    _____
    .
    Hint

    The model is learning the training examples too specifically.

    Answer

    overfitting

  56. 56
    For multiclass accuracy, argmax selects the class with the
    _____
    output probability.
    Hint

    The selected class has the largest predicted score.

    Answer

    highest

  57. 57
    Dropout combats overfitting by randomly
    _____
    a fraction of neurons during training.
    Hint

    Some neurons are temporarily prevented from contributing.

    Answer

    deactivating

  58. 58
    The dropout parameter p specifies the probability that a neuron is set to
    _____
    .
    Hint

    Dropped neurons contribute no activation.

    Answer

    zero

  59. 59
    Weight decay regularizes a model by encouraging its weights to remain
    _____
    .
    Hint

    The penalty discourages excessive growth of parameter values.

    Answer

    small

  60. 60
    Creating altered versions of existing examples, such as rotated or scaled images, is called data
    _____
    .
    Hint

    This technique artificially expands a dataset.

    Answer

    augmentation

  61. 61
    A useful first check before training on an entire dataset is to see whether the model can overfit a
    _____
    data point.
    Hint

    Begin with just one example to check that the problem and implementation are workable.

    Answer

    single

  62. 62
    Grid search tests hyperparameter values at predetermined intervals, while random search samples values
    _____
    within a specified range.
    Hint

    Unlike grid search, this method does not test only a fixed set of points.

    Answer

    randomly

  63. 63
    A digital image is made up of small units called
    _____
    .
    Hint

    Each is a tiny square representing one point in the image.

    Answer

    pixels

  64. 64
    In a grayscale image, pixel values can represent shades from black to white using integers from 0 to
    _____
    .
    Hint

    This is the upper endpoint of the described 8-bit intensity range.

    Answer

    255

  65. 65
    A typical color image pixel is represented by red, green, and
    _____
    intensity values.
    Hint

    This is the third channel in the standard RGB representation.

    Answer

    blue

  66. 66
    PyTorch Vision's ImageFolder can organize image data by treating each category
    _____
    as a class.
    Hint

    Images are stored inside separate folders corresponding to categories.

    Answer

    directory

  67. 67
    Resizing every loaded image to the same height and width ensures images have consistent
    _____
    .
    Hint

    Models need image dimensions that can be handled consistently in batches.

    Answer

    size

  68. 68
    In a color image tensor shaped as batch, channels, height, and width, the channel dimension contains
    _____
    color channels.
    Hint

    The channels correspond to the standard color components.

    Answer

    three

  69. 69
    Image augmentation should be chosen with the data and task in mind because some transformations can change or confuse the example's
    _____
    .
    Hint

    A transformed image must still represent the same target category.

    Answer

    label

  70. 70
    A convolutional layer uses small grids called
    _____
    that slide over the input.
    Hint

    These learn local patterns and are applied at multiple positions.

    Answer

    filters

  71. 71
    The output of applying a convolutional filter across an input is a
    _____
    map.
    Hint

    It records the pattern responses at different input locations.

    Answer

    feature

  72. 72
    A convolution operation combines an input patch and a filter by multiplying corresponding elements and summing the results, which is their
    _____
    product.
    Hint

    This operation multiplies corresponding values and then adds them.

    Answer

    dot

  73. 73
    Adding zeros around an image before convolution to help preserve spatial dimensions is called zero
    _____
    .
    Hint

    This technique adds a border around the input.

    Answer

    padding

  74. 74
    A max-pooling window forwards the
    _____
    value found inside each window.
    Hint

    The operation keeps the largest activation in its region.

    Answer

    maximum

  75. 75
    A max-pooling window of size two by two halves a feature map's height and
    _____
    .
    Hint

    The other spatial dimension is reduced along with height.

    Answer

    width

  76. 76
    A convolutional network's feature extractor output is often converted into a vector using a
    _____
    operation before the classifier.
    Hint

    This turns multiple feature-map dimensions into one vector.

    Answer

    flatten

  77. 77
    Compared with large fully connected layers, convolutional layers reduce parameter counts by sharing small filters and preserve information about
    _____
    patterns.
    Hint

    These patterns concern the arrangement and location of image features.

    Answer

    spatial

  78. 78
    Precision measures the fraction of predicted positive examples that are correct, while recall measures the fraction of actual positive examples correctly
    _____
    .
    Hint

    Recall asks how many of the real positive cases the model successfully identifies.

    Answer

    predicted

  79. 79
    Macro averaging calculates a metric for each class independently and then gives every class
    _____
    influence in the final mean.
    Hint

    Class size does not affect each class's contribution under this average.

    Answer

    equal

  80. 80
    Weighted averaging gives each class's score influence proportional to its number of
    _____
    .
    Hint

    Larger classes receive greater weight in this average.

    Answer

    samples

  81. 81
    Micro averaging combines true positives, false positives, and false negatives across all classes before calculating the metric
    _____
    .
    Hint

    Rather than averaging class-specific scores, it pools counts across classes.

    Answer

    globally

  82. 82
    When performance on smaller classes matters equally, even if the dataset is imbalanced,
    _____
    averaging can be appropriate.
    Hint

    This averaging method treats each class equally.

    Answer

    macro

  83. 83
    Sequential data is data in which the order of data points matters and may contain temporal or spatial
    _____
    .
    Hint

    Earlier or neighboring values can be related to later values.

    Answer

    dependencies

  84. 84
    Randomly splitting time series data can cause lookahead bias because the model may indirectly access information from the
    _____
    .
    Hint

    Forecasting should be tested on data that occurs after the training period.

    Answer

    future

  85. 85
    For electricity readings collected every 15 minutes, a 24-hour input sequence contains
    _____
    data points.
    Hint

    There are four 15-minute intervals in each hour.

    Answer

    96

  86. 86
    In next-step forecasting, the target is the data point immediately
    _____
    the input sequence.
    Hint

    The model predicts the next value following the observed window.

    Answer

    after

  87. 87
    Unlike a feedforward network, a recurrent neural network passes a hidden state from one time step to the
    _____
    .
    Hint

    This feedback connection carries information through the sequence.

    Answer

    next

  88. 88
    At the first time step of a recurrent sequence, when no previous hidden state exists, it is typically initialized to
    _____
    .
    Hint

    The initial state is set to a neutral value.

    Answer

    zero

  89. 89
    A recurrent network that receives a sequence and uses the output at every time step is a sequence-to-
    _____
    architecture.
    Hint

    It produces a sequence of outputs rather than only one final output.

    Answer

    sequence

  90. 90
    A recurrent network that reads an entire input sequence and uses only its final output is a sequence-to-
    _____
    architecture.
    Hint

    It condenses the processed sequence into one output, such as a text category.

    Answer

    vector

  91. 91
    A model that takes a single input and generates outputs at multiple time steps follows a vector-to-
    _____
    architecture.
    Hint

    It can generate a series of words from one input representation.

    Answer

    sequence

  92. 92
    In an encoder-decoder architecture, the input sequence is processed before the model begins generating the output
    _____
    .
    Hint

    This separates input processing from the generated response.

    Answer

    sequence

  93. 93
    An LSTM's additional state for retaining long-term information is commonly denoted by
    _____
    .
    Hint

    The other LSTM state, often denoted by H, represents short-term memory.

    Answer

    C

  94. 94
    Within an LSTM, the
    _____
    gate removes selected information from long-term memory.
    Hint

    Its role is to discard information that is no longer needed.

    Answer

    forget

  95. 95
    Within an LSTM, the
    _____
    gate selects important information to store in long-term memory.
    Hint

    It controls which new information enters the cell state.

    Answer

    input

  96. 96
    Compared with an LSTM, a GRU merges long-term and short-term memory into a single
    _____
    state.
    Hint

    It does not maintain the separate cell state used by an LSTM.

    Answer

    hidden

  97. 97
    Because a GRU is less complex than an LSTM, it generally requires less
    _____
    .
    Hint

    Its simpler structure can reduce the resources needed to process data.

    Answer

    computation

  98. 98
    For a recurrent layer, the common input layout is batch size, sequence length, and number of
    _____
    .
    Hint

    This final dimension counts the values available at each time step.

    Answer

    features

  99. 99
    When model outputs have an extra size-one dimension that labels lack, the squeeze operation removes that dimension so their
    _____
    match.
    Hint

    Loss functions require predictions and targets to have the same dimensions.

    Answer

    shapes

  100. 100
    In object-oriented programming, an object combines data called attributes with abilities called
    _____
    .
    Hint

    These are functions associated with an object.

    Answer

    methods

  101. 101
    The class method called when a new object is created is the
    _____
    method.
    Hint

    It is the constructor-like method used to initialize an object's attributes.

    Answer

    init

  102. 102
    In a Python class method, the conventional first argument referring to the current object is
    _____
    .
    Hint

    It allows the method to access that object's attributes and methods.

    Answer

    self

  103. 103
    A custom PyTorch dataset implements a method that returns the total number of samples, called
    _____
    .
    Hint

    This method reports the dataset's length.

    Answer

    len

  104. 104
    A custom PyTorch dataset implements the method that retrieves a sample by index, called
    _____
    .
    Hint

    This method lets indexing return one example and its label.

    Answer

    get item

  105. 105
    In a class-based PyTorch model, the method that defines how inputs pass through the layers is
    _____
    .
    Hint

    It specifies the model's computation from input to output.

    Answer

    forward

  106. 106
    Adaptive gradient, or Adagrad, is particularly suited to sparse data because it reduces the learning rate for parameters that are
    _____
    updated.
    Hint

    Some features appear only rarely in the data.

    Answer

    infrequently

  107. 107
    RMSprop adapts the learning rate for each parameter based on the size of its previous
    _____
    .
    Hint

    These values indicate the recent direction and magnitude of the loss change.

    Answer

    gradients

  108. 108
    Adam combines RMSprop with the concept of
    _____
    from past gradients.
    Hint

    It uses a weighted average that gives more influence to recent gradients.

    Answer

    momentum

  109. 109
    To reduce unstable gradients, initialization should keep the variance of a layer's inputs close to the variance of its
    _____
    .
    Hint

    The distributions on both sides of the layer should have similar variance.

    Answer

    outputs

  110. 110
    He initialization is a weight initialization method suited to
    _____
    and similar activation functions.
    Hint

    Its name is also associated with Kaiming initialization.

    Answer

    ReLU

  111. 111
    Standard ReLU can cause the dying neuron problem because its output is zero for any
    _____
    input.
    Hint

    The activation suppresses values below zero.

    Answer

    negative

  112. 112
    ELU can help avoid the dying neuron problem because its gradients remain non-zero for
    _____
    values.
    Hint

    Unlike standard ReLU, it does not simply output zero throughout this region.

    Answer

    negative

  113. 113
    Batch normalization first normalizes layer outputs by subtracting the mean and dividing by the
    _____
    deviation.
    Hint

    This statistical measure describes spread around the mean.

    Answer

    standard

  114. 114
    After normalization, batch normalization learns scale and
    _____
    parameters for the layer outputs.
    Hint

    Together, these parameters adjust the normalized distribution.

    Answer

    shift

  115. 115
    Batch normalization's input size should equal the preceding layer's
    _____
    size.
    Hint

    It must match the number of values produced by the layer before it.

    Answer

    output

  116. 116
    A model trained on one task and reused as a starting point for another task is an example of
    _____
    learning.
    Hint

    The learned weights are carried from a first task to a second.

    Answer

    transfer

  117. 117
    When reusing a pretrained model for a similar task, training it with a smaller learning rate is called
    _____
    .
    Hint

    This is a specific form of transfer learning.

    Answer

    fine tuning

  118. 118
    A common transfer-learning guideline is to freeze early layers and fine tune layers closer to the
    _____
    layer.
    Hint

    These later layers are nearer to the model's predictions.

    Answer

    output

  119. 119
    A multi-input model can compare two representations to learn whether they refer to the same
    _____
    .
    Hint

    This is the goal in examples such as comparing a passport photo with a live image.

    Answer

    object

  120. 120
    In the Omniglot multi-input example, the character image is paired with a one-hot vector representing its
    _____
    .
    Hint

    The vector identifies which writing system the character comes from.

    Answer

    alphabet

  121. 121
    After processing the image and alphabet inputs separately, the example multi-input model joins their representations using tensor
    _____
    .
    Hint

    This operation combines tensors along a specified dimension.

    Answer

    concatenation

  122. 122
    In the multi-output Omniglot example, the model predicts both the character and the
    _____
    it belongs to.
    Hint

    This is the second classification target besides character identity.

    Answer

    alphabet

  123. 123
    For a multi-label classification problem, one input may belong to
    _____
    classes simultaneously.
    Hint

    An image might, for example, depict both a beach and people.

    Answer

    multiple

  124. 124
    When a model has multiple outputs, it can combine the partial losses by summing them if each task is considered
    _____
    important.
    Hint

    Neither task receives extra emphasis in this case.

    Answer

    equally

  125. 125
    If character classification is twice as important as alphabet classification, the character loss can be multiplied by
    _____
    .
    Hint

    The loss weight should reflect the stated relative importance.

    Answer

    two

  126. 126
    When combining losses of very different magnitudes, the larger loss may dominate and cause the model to ignore the
    _____
    loss.
    Hint

    The issue is that one objective can overwhelm the other numerically.

    Answer

    smaller

  127. 127
    Scaling each loss by dividing it by the maximum value in its batch can bring the losses into a more comparable
    _____
    .
    Hint

    The scaling is intended to put the losses on a similar numerical scale.

    Answer

    range

  128. 128
    A multi-output model requires a separate accuracy metric for each output task during
    _____
    .
    Hint

    Each prediction target has its own performance score.

    Answer

    evaluation

  129. 129
    In the Omniglot example, alphabet prediction is easier than character prediction partly because it has 30 classes instead of
    _____
    .
    Hint

    This is the number of possible character labels.

    Answer

    964

1 of 129
Question 1 of 129

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent