1. Home
  2. Explore
  3. Computer Science
  4. Deep Learning for Computer Vision

Study methods

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

Deep Learning for Computer Vision

  • 103Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Tensors and Variables
A
is a multi-dimensional array, the core data structure in TensorFlow.

103 questions

  1. 1
    A
    _____
    is a multi-dimensional array, the core data structure in TensorFlow.
    Hint

    It's the fundamental building block in TensorFlow, like a matrix but more general.

    Answer

    tensor

  2. 2
    A scalar (0-dimensional) tensor has
    _____
    dimensions.
    Hint

    Think about the number of indices needed to access a single element.

    Answer

    0

  3. 3
    A 1-dimensional tensor is also called a
    _____
    .
    Hint

    It's a list of numbers, like in linear algebra.

    Answer

    vector

  4. 4
    The function
    _____
    is used to create a constant tensor with specified values.
    Hint

    It's similar to creating a constant array in NumPy.

    Answer

    tf.constant

  5. 5
    When creating a tensor, you can specify the data type using the parameter
    _____
    .
    Hint

    It's short for 'data type'.

    Answer

    dtype

  6. 6
    The function
    _____
    creates a tensor with all elements set to 1.
    Hint

    It's similar to np.ones in NumPy.

    Answer

    tf.ones

  7. 7
    The function
    _____
    creates a tensor with all elements set to 0.
    Hint

    It's the counterpart of tf.ones.

    Answer

    tf.zeros

  8. 8
    The function
    _____
    creates an identity matrix tensor.
    Hint

    It's the tensor equivalent of np.eye.

    Answer

    tf.eye

  9. 9
    The function
    _____
    creates a tensor filled with a specific scalar value.
    Hint

    It's like np.full.

    Answer

    tf.fill

  10. 10
    To create a tensor with random values from a normal distribution, use the function
    _____
    .
    Hint

    It samples from a Gaussian distribution.

    Answer

    tf.random.normal

  11. 11
    The number of dimensions of a tensor is called its
    _____
    .
    Hint

    It's the tensor's dimensionality.

    Answer

    rank

  12. 12
    The total number of elements in a tensor is its
    _____
    .
    Hint

    It's the product of all dimensions.

    Answer

    size

  13. 13
    To select a subrange of elements from a tensor, you use
    _____
    notation.
    Hint

    It's similar to Python list slicing with colons.

    Answer

    slicing

  14. 14
    The
    _____
    symbol in tensor indexing is used to represent multiple unspecified dimensions.
    Hint

    It's three dots: ...

    Answer

    ellipsis

  15. 15
    Adding a scalar to a tensor involves the concept of
    _____
    .
    Hint

    It allows operations on tensors of different shapes.

    Answer

    broadcasting

  16. 16
    The function
    _____
    computes the matrix product of two tensors.
    Hint

    It's the tensor version of matrix multiplication.

    Answer

    tf.linalg.matmul

  17. 17
    The function
    _____
    transposes a tensor.
    Hint

    It swaps axes, like transposing a matrix.

    Answer

    tf.transpose

  18. 18
    A
    _____
    tensor is used for non-rectangular data where each row may have a different length.
    Hint

    Unlike a regular tensor, it can have variable-length sequences.

    Answer

    ragged

  19. 19
    A
    _____
    tensor efficiently stores data with a large number of zero elements.
    Hint

    It saves memory by only storing non-zero values and their indices.

    Answer

    sparse

  20. 20
    A tensor with string elements is called a
    _____
    tensor.
    Hint

    It holds text data.

    Answer

    string

  21. 21
    A
    _____
    is a mutable tensor that can be updated during training.
    Hint

    Unlike constants, this tensor's value can change.

    Answer

    tf.Variable

  22. 22
    To assign a new value to a tf.Variable, use the method
    _____
    .
    Hint

    It sets the variable's value to a given tensor.

    Answer

    assign

  23. 23
    To add a value to a tf.Variable in-place, use the method
    _____
    .
    Hint

    It adds the given tensor to the current value.

    Answer

    assign_add

  24. 24
    To subtract a value from a tf.Variable in-place, use the method
    _____
    .
    Hint

    It subtracts the given tensor from the current value.

    Answer

    assign_sub

  25. 25
    In a linear regression model, the output of a Dense layer is computed as $Y =
    _____
    • X + B$.
    Hint

    It's the weight matrix.

    Answer

    W

  26. 26
    The
    _____
    layer in TensorFlow normalizes input features using mean and variance.
    Hint

    It's a preprocessing layer for scaling features.

    Answer

    Normalization

  27. 27
    The loss function
    _____
    penalizes outliers heavily because it squares the errors.
    Hint

    It's the average of squared differences between predictions and targets.

    Answer

    Mean Squared Error (MSE)

  28. 28
    The loss function
    _____
    is more robust to outliers because it uses absolute differences.
    Hint

    It's the average of absolute differences.

    Answer

    Mean Absolute Error (MAE)

  29. 29
    The
    _____
    loss combines properties of both MSE and MAE, being quadratic for small errors and linear for larger ones.
    Hint

    It has a parameter that controls the transition point.

    Answer

    Huber

  30. 30
    The optimizer
    _____
    updates model parameters using the learning rate and gradient of the loss.
    Hint

    It's the basic optimizer that moves in the direction of steepest descent.

    Answer

    Stochastic Gradient Descent (SGD)

  31. 31
    A popular optimizer that adapts the learning rate for each parameter is
    _____
    .
    Hint

    It combines momentum and adaptive learning rates.

    Answer

    Adam

  32. 32
    If the learning rate is too large, training may
    _____
    .
    Hint

    The loss may increase instead of decrease.

    Answer

    diverge

  33. 33
    The metric
    _____
    is the square root of the mean of squared errors.
    Hint

    It's in the same units as the target variable.

    Answer

    Root Mean Square Error (RMSE)

  34. 34
    A dataset should be split into training, validation, and
    _____
    sets.
    Hint

    This set is used for final evaluation after model selection.

    Answer

    test

  35. 35
    The
    _____
    method in tf.data.Dataset shuffles the data randomly each epoch.
    Hint

    It randomizes the order of examples.

    Answer

    shuffle

  36. 36
    The
    _____
    method in tf.data.Dataset groups consecutive elements into batches.
    Hint

    It returns a dataset of batches from the original dataset.

    Answer

    batch

  37. 37
    The
    _____
    method in tf.data.Dataset prepares data for efficient streaming by overlapping preprocessing.
    Hint

    It allows data preparation to happen in parallel with training.

    Answer

    prefetch

  38. 38
    An image is represented as a tensor of shape (height, width,
    _____
    ).
    Hint

    Usually 3 for RGB images.

    Answer

    channels

  39. 39
    The dataset
    _____
    provides the Malaria cell images dataset for binary classification.
    Hint

    It's a library of ready-to-use datasets.

    Answer

    tensorflow_datasets

  40. 40
    Pixel values are typically normalized by dividing by
    _____
    to scale them between 0 and 1.
    Hint

    The maximum pixel intensity value.

    Answer

    255

  41. 41
    A
    _____
    layer uses a small filter that slides over the input to detect features.
    Hint

    It's the fundamental building block for processing grid-like data.

    Answer

    Convolutional

  42. 42
    The parameter
    _____
    controls the step size of the filter as it slides across the input.
    Hint

    It determines how many pixels the filter moves at a time.

    Answer

    stride

  43. 43
    The two common types of padding are 'valid' and
    _____
    .
    Hint

    'same' pads the input so output size equals input size.

    Answer

    same

  44. 44
    The
    _____
    activation function introduces non-linearity and sets negative values to zero.
    Hint

    It's the most common activation in hidden layers.

    Answer

    ReLU

  45. 45
    The
    _____
    layer normalizes the outputs of a layer to stabilize training.
    Hint

    It reduces internal covariate shift.

    Answer

    Batch Normalization

  46. 46
    A
    _____
    layer reduces the spatial dimensions of a feature map by taking the maximum or average of a window.
    Hint

    It downsamples the representation.

    Answer

    Pooling

  47. 47
    The
    _____
    layer converts a multi-dimensional feature map into a 1D vector for classification.
    Hint

    It's used before the final dense layers.

    Answer

    Flatten

  48. 48
    For binary classification, the standard loss function is
    _____
    .
    Hint

    It measures the difference between true and predicted probabilities.

    Answer

    Binary Cross-Entropy

  49. 49
    Besides accuracy, important metrics when classes are imbalanced include precision, recall, and
    _____
    .
    Hint

    It's the harmonic mean of precision and recall.

    Answer

    F1-score

  50. 50
    The
    _____
    API in Keras is a linear stack of layers, ideal for simple models.
    Hint

    It's the simplest way to define a model layer by layer.

    Answer

    Sequential

  51. 51
    The
    _____
    API allows models with multiple inputs, outputs, and shared layers.
    Hint

    It supports complex topologies like skip connections.

    Answer

    Functional

  52. 52
    Building a model by subclassing
    _____
    provides maximum flexibility for custom forward passes.
    Hint

    You define the call method for custom logic.

    Answer

    tf.keras.Model

  53. 53
    To create a custom layer, you subclass
    _____
    .
    Hint

    You can define weights and behavior in the call method.

    Answer

    tf.keras.layers.Layer

  54. 54
    The context manager
    _____
    is used to record gradients for custom training loops.
    Hint

    It records operations for automatic differentiation.

    Answer

    tf.GradientTape

  55. 55
    By default, TensorFlow executes operations immediately in
    _____
    mode.
    Hint

    It's the default mode since TF 2.0.

    Answer

    eager

  56. 56
    The decorator
    _____
    converts a Python function into a callable TensorFlow graph.
    Hint

    It traces the function into a static graph for performance.

    Answer

    @tf.function

  57. 57
    A
    _____
    is an object that performs actions at various stages of training (e.g., early stopping).
    Hint

    It's passed to model.fit to automate tasks.

    Answer

    callback

  58. 58
    The callback
    _____
    stops training when a monitored metric stops improving.
    Hint

    It prevents overfitting by halting training early.

    Answer

    EarlyStopping

  59. 59
    The callback
    _____
    saves the model's weights at specified intervals, often when a metric improves.
    Hint

    It saves the best model during training.

    Answer

    ModelCheckpoint

  60. 60
    The callback
    _____
    adjusts the learning rate according to a schedule function.
    Hint

    It calls a function to get new learning rate each epoch.

    Answer

    LearningRateScheduler

  61. 61
    The callback
    _____
    reduces the learning rate when a metric has plateaued.
    Hint

    It decreases the learning rate when improvement stalls.

    Answer

    ReduceLROnPlateau

  62. 62
    The
    _____
    callback logs metrics for visualization in TensorBoard.
    Hint

    It writes logs that can be viewed in a web interface.

    Answer

    TensorBoard

  63. 63
    The data augmentation technique
    _____
    creates new samples by combining two images and their labels linearly.
    Hint

    It mixes images using a random weight.

    Answer

    Mixup

  64. 64
    The data augmentation technique
    _____
    cuts a patch from one image and pastes it onto another, adjusting labels.
    Hint

    It combines images by swapping regions.

    Answer

    CutMix

  65. 65
    A popular library for advanced image augmentations is
    _____
    .
    Hint

    It provides fast and diverse image transformations.

    Answer

    Albumentations

  66. 66
    Weights & Biases (W&B) is an MLOps platform that integrates with Keras via a
    _____
    .
    Hint

    It's passed to model.fit like other callbacks.

    Answer

    callback

  67. 67
    TFRecord is an efficient binary format for storing
    _____
    data.
    Hint

    It's used for large-scale data pipelines.

    Answer

    serialized

  68. 68
    Overfitting occurs when a model performs well on training data but poorly on
    _____
    data.
    Hint

    Data not used during training.

    Answer

    unseen

  69. 69
    Underfitting occurs when a model is too
    _____
    to capture the underlying pattern in the data.
    Hint

    The model lacks capacity.

    Answer

    simple

  70. 70
    The technique
    _____
    randomly drops out a fraction of neurons during training to prevent overfitting.
    Hint

    It forces the network to learn redundant representations.

    Answer

    Dropout

  71. 71
    Regularization that adds a penalty proportional to the absolute value of weights is called
    _____
    regularization.
    Hint

    It can lead to sparse weights.

    Answer

    L1

  72. 72
    Regularization that adds a penalty proportional to the square of weights is called
    _____
    regularization.
    Hint

    It's also known as weight decay.

    Answer

    L2

  73. 73
    For multi-class classification, the output layer uses a
    _____
    activation to produce a probability distribution.
    Hint

    It ensures the outputs sum to 1.

    Answer

    softmax

  74. 74
    The loss function for multi-class classification with integer labels is
    _____
    .
    Hint

    It's used when labels are integers, not one-hot encoded.

    Answer

    SparseCategoricalCrossentropy

  75. 75
    The metric
    _____
    measures accuracy when the true class is among the top K predicted classes.
    Hint

    It's more permissive than standard accuracy.

    Answer

    TopKCategoricalAccuracy

  76. 76
    AlexNet, introduced in 2012, used
    _____
    activations and multiple GPUs for training.
    Hint

    This activation helped solve the vanishing gradient problem.

    Answer

    ReLU

  77. 77
    VGGNet showed that using many stacked layers with
    _____
    filters is effective and computationally efficient.
    Hint

    Small filters are used throughout the network.

    Answer

    3x3

  78. 78
    ResNet introduced
    _____
    blocks with skip connections to allow training of very deep networks.
    Hint

    They add the input to the output of a layer.

    Answer

    residual

  79. 79
    MobileNet uses
    _____
    separable convolutions to reduce computational cost.
    Hint

    It separates spatial and channel convolutions.

    Answer

    depthwise

  80. 80
    EfficientNet uses a compound scaling method to uniformly scale
    _____
    , width, and input resolution.
    Hint

    It's one of the three scaling dimensions: depth, width, resolution.

    Answer

    depth

  81. 81
    Transfer learning uses a
    _____
    model trained on a large dataset as a feature extractor for a new task.
    Hint

    It's already learned general features.

    Answer

    pre-trained

  82. 82
    Fine-tuning involves unfreezing some layers of a pre-trained model and training with a very
    _____
    learning rate.
    Hint

    To prevent destroying learned features.

    Answer

    low

  83. 83
    Grad-CAM produces a
    _____
    that highlights regions of the input image important for a model's prediction.
    Hint

    It's a class activation map.

    Answer

    heatmap

  84. 84
    Vision Transformers (ViTs) split an image into fixed-size
    _____
    for processing.
    Hint

    They are flattened and linearly embedded.

    Answer

    patches

  85. 85
    ViTs add a learnable
    _____
    token whose final representation is used for classification.
    Hint

    It's similar to the [CLS] token in BERT.

    Answer

    class

  86. 86
    The ONNX format allows models to be converted between different frameworks and run using
    _____
    .
    Hint

    It's a cross-platform inference engine.

    Answer

    ONNX Runtime

  87. 87
    Quantization reduces model size and speeds up inference by converting weights to
    _____
    -bit integers.
    Hint

    It's a common lower precision format.

    Answer

    8

  88. 88
    TensorFlow
    _____
    is a library for deploying models on mobile and edge devices.
    Hint

    It's optimized for on-device inference.

    Answer

    Lite

  89. 89
    A REST API can be built to serve a model using the
    _____
    framework.
    Hint

    It's a modern Python web framework.

    Answer

    FastAPI

  90. 90
    The tool
    _____
    is used for load testing APIs by simulating multiple users.
    Hint

    It defines user behavior in Python.

    Answer

    Locust

  91. 91
    YOLO frames object detection as a
    _____
    problem, predicting bounding boxes and class probabilities from the entire image.
    Hint

    It directly outputs coordinates and confidence scores.

    Answer

    regression

  92. 92
    YOLO divides the input image into an S×SS \times SS×S
    _____
    .
    Hint

    Each cell is responsible for detecting objects whose center falls in it.

    Answer

    grid

  93. 93
    In YOLO, each grid cell predicts
    _____
    bounding boxes.
    Hint

    It's a hyperparameter, often 2.

    Answer

    B

  94. 94
    The bounding box coordinates in YOLO are predicted relative to the
    _____
    cell.
    Hint

    They are offset from the cell's location.

    Answer

    grid

  95. 95
    Intersection over Union (IoU) is a metric used to measure the overlap between
    _____
    boxes.
    Hint

    It's used to determine if a detection is valid.

    Answer

    bounding

  96. 96
    Non-Max Suppression (NMS) is a post-processing step that eliminates
    _____
    detections by removing boxes with high IoU overlap.
    Hint

    It keeps only the most confident bounding box per object.

    Answer

    duplicate

  97. 97
    In a Variational Autoencoder (VAE), the encoder outputs a
    _____
    and variance for each latent feature.
    Hint

    It defines a probability distribution in the latent space.

    Answer

    mean

  98. 98
    The
    _____
    trick in VAEs allows backpropagation through the random sampling process.
    Hint

    It expresses the sample as a deterministic function of parameters and noise.

    Answer

    reparameterization

  99. 99
    The VAE loss consists of a reconstruction loss and a
    _____
    divergence loss acting as a regularizer.
    Hint

    It measures difference between the learned distribution and a prior.

    Answer

    KL

  100. 100
    In a Generative Adversarial Network (GAN), the
    _____
    network tries to create realistic fake data.
    Hint

    It learns to produce synthetic samples.

    Answer

    Generator

  101. 101
    In a GAN, the
    _____
    network tries to distinguish real data from generated ones.
    Hint

    It acts as a classifier.

    Answer

    Discriminator

  102. 102
    DCGAN stands for Deep Convolutional
    _____
    .
    Hint

    It uses convolutional layers in both Generator and Discriminator.

    Answer

    Generative Adversarial Network

  103. 103
    One tip for stable GAN training is to use
    _____
    smoothing, where real labels are set to a value less than 1.
    Hint

    It prevents the Discriminator from becoming too confident.

    Answer

    label

1 of 103
Question 1 of 103

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent