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

Study methods

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

Convolutional Neural Networks

  • 20Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Machine Learning Basics

What is machine learning?

20 questions

  1. 1

    What is machine learning?

    1. A

      A method for computers to perform arithmetic operations faster than humans

    2. B

      A subdomain of computer science that focuses on algorithms that learn from data without explicit programming

    3. C

      The study of how computers can mimic human emotions

    4. D

      A branch of mathematics dealing with probability distributions

    Correct answer
    B

    A subdomain of computer science that focuses on algorithms that learn from data without explicit programming

    Explanation

    Machine learning is a subdomain of computer science that focuses on algorithms that help a computer learn from data without being explicitly programmed for every instruction.

  2. 2

    In supervised learning, what is used to train models?

    1. A

      Unlabeled data to discover patterns

    2. B

      Labeled inputs with corresponding output labels

    3. C

      Rewards and penalties from an environment

    4. D

      Only input features without any targets

    Correct answer
    B

    Labeled inputs with corresponding output labels

    Explanation

    Supervised learning uses labeled inputs, where each input has a corresponding output label, to train the model.

  3. 3

    Which type of machine learning involves an agent learning from rewards and penalties in an interactive environment?

    1. A

      Transfer learning

    2. B

      Unsupervised learning

    3. C

      Supervised learning

    4. D

      Reinforcement learning

    Correct answer
    D

    Reinforcement learning

    Explanation

    Reinforcement learning involves an agent learning based on rewards or penalties while interacting with an environment.

  4. 4

    What distinguishes nominal data from ordinal data?

    1. A

      Nominal data is discrete, while ordinal data is continuous

    2. B

      Nominal data is quantitative, while ordinal data is qualitative

    3. C

      Nominal data has numerical values, while ordinal data has categorical values

    4. D

      Nominal data has no inherent order, while ordinal data has a natural ranking

    Correct answer
    D

    Nominal data has no inherent order, while ordinal data has a natural ranking

    Explanation

    Nominal data is categorical without order (e.g., country), whereas ordinal data has a natural order (e.g., happiness rating).

  5. 5

    In the context of machine learning, what is a feature vector?

    1. A

      The weights of a neural network layer

    2. B

      The output label of a sample

    3. C

      A vector of numerical values representing the input sample

    4. D

      A matrix containing all the training samples

    Correct answer
    C

    A vector of numerical values representing the input sample

    Explanation

    A feature vector is the input to the model, typically a vector of numbers representing the attributes of a sample.

  6. 6

    What is the primary difference between classification and regression tasks?

    1. A

      Classification predicts discrete classes, while regression predicts continuous values

    2. B

      Classification uses labeled data, while regression uses unlabeled data

    3. C

      Classification is supervised, while regression is unsupervised

    4. D

      Classification outputs probabilities, while regression outputs integers

    Correct answer
    A

    Classification predicts discrete classes, while regression predicts continuous values

    Explanation

    Classification predicts discrete categories (e.g., hot dog or not), while regression predicts continuous numerical values (e.g., price).

  7. 7

    What is the purpose of a validation set in machine learning?

    1. A

      To select the best model among multiple candidates

    2. B

      To augment the training data by creating variations

    3. C

      To train the model on additional data

    4. D

      To provide a final accuracy assessment after model selection

    Correct answer
    A

    To select the best model among multiple candidates

    Explanation

    The validation set is used to compare different models and choose the best one, acting as a test drive before final evaluation.

  8. 8

    Which loss function is typically used for binary classification?

    1. A

      L1 loss

    2. B

      Binary cross-entropy loss

    3. C

      Hinge loss

    4. D

      Mean squared error loss

    Correct answer
    B

    Binary cross-entropy loss

    Explanation

    Binary cross-entropy loss is used for binary classification problems, as mentioned in the course for the hot dog classifier.

  9. 9

    How does L2 loss differ from L1 loss in terms of penalizing errors?

    1. A

      L2 loss penalizes larger errors more heavily due to its quadratic nature

    2. B

      L1 loss penalizes larger errors more heavily due to its quadratic nature

    3. C

      L2 loss is linear, while L1 loss is quadratic

    4. D

      L1 loss is used for classification, while L2 loss is for regression

    Correct answer
    A

    L2 loss penalizes larger errors more heavily due to its quadratic nature

    Explanation

    L2 loss is quadratic (error squared), so larger errors are penalized more than in L1 loss, which is linear.

  10. 10

    In a neural network, what is the role of an activation function?

    1. A

      To compute the loss between prediction and target

    2. B

      To introduce non-linearity so the network can learn complex patterns

    3. C

      To reduce the number of parameters in the network

    4. D

      To normalize the inputs to have zero mean

    Correct answer
    B

    To introduce non-linearity so the network can learn complex patterns

    Explanation

    Activation functions add non-linearity; without them, the entire network collapses into a linear model.

  11. 11

    Which activation function is described as a rectified linear unit and is commonly used in hidden layers?

    1. A

      Sigmoid

    2. B

      Softmax

    3. C

      Tanh

    4. D

      ReLU

    Correct answer
    D

    ReLU

    Explanation

    ReLU (Rectified Linear Unit) is a classic activation function that is often used and was recommended in the course.

  12. 12

    What does gradient descent do during training?

    1. A

      Augments the training data by creating new samples

    2. B

      Randomly initializes all weights

    3. C

      Adjusts the weights in the direction that minimizes the loss function

    4. D

      Calculates the accuracy on the validation set

    Correct answer
    C

    Adjusts the weights in the direction that minimizes the loss function

    Explanation

    Gradient descent follows the slope (gradient) of the loss function to update weights and reduce the loss.

  13. 13

    What is the purpose of a convolution operation in a CNN?

    1. A

      To normalize pixel values between 0 and 1

    2. B

      To reduce the dimensions of the image by taking averages

    3. C

      To flatten the image into a vector for classification

    4. D

      To extract features from an image by applying a filter

    Correct answer
    D

    To extract features from an image by applying a filter

    Explanation

    Convolution applies a filter (kernel) over the image to extract important features like edges.

  14. 14

    What does max pooling do in a CNN?

    1. A

      Reduces the spatial dimensions by taking the maximum value in each window

    2. B

      Applies a nonlinear activation function to each pixel

    3. C

      Flattens the feature maps into a vector

    4. D

      Increases the resolution by interpolating between pixels

    Correct answer
    A

    Reduces the spatial dimensions by taking the maximum value in each window

    Explanation

    Max pooling takes the largest value from a small window (e.g., 2x2) to downsample the feature map.

  15. 15

    Why is data augmentation used in training CNNs?

    1. A

      To increase the variety of training data and reduce overfitting

    2. B

      To convert all images to grayscale

    3. C

      To remove noisy images from the dataset

    4. D

      To reduce the size of the dataset for faster training

    Correct answer
    A

    To increase the variety of training data and reduce overfitting

    Explanation

    Data augmentation (e.g., random flips, rotations) artificially expands the training set, making the model more robust.

  16. 16

    What is the effect of a dropout layer in a neural network?

    1. A

      It randomly turns off a fraction of neurons during training to prevent overfitting

    2. B

      It increases the number of filters in convolutional layers

    3. C

      It adds noise to the input images

    4. D

      It reduces the learning rate during training

    Correct answer
    A

    It randomly turns off a fraction of neurons during training to prevent overfitting

    Explanation

    Dropout randomly disables a percentage of connections, forcing the network to learn redundant representations and avoid overfitting.

  17. 17

    What is overfitting?

    1. A

      When the model achieves high accuracy on both training and validation sets

    2. B

      When the training loss decreases but validation loss also decreases

    3. C

      When the model fails to learn anything from the training data

    4. D

      When the model performs well on training data but poorly on new, unseen data

    Correct answer
    D

    When the model performs well on training data but poorly on new, unseen data

    Explanation

    Overfitting occurs when the model memorizes the training data and cannot generalize to new data, as seen when training accuracy was 100% but validation accuracy was lower.

  18. 18

    In the hot dog classifier, why was it necessary to rebalance the dataset?

    1. A

      Because the original dataset had many more not-hot-dog images than hot dog images

    2. B

      Because the training set was too large to fit in memory

    3. C

      Because the images were all different sizes

    4. D

      Because the validation set contained no hot dogs

    Correct answer
    A

    Because the original dataset had many more not-hot-dog images than hot dog images

    Explanation

    The dataset had only 750 hot dog images but many more not-hot-dog images, so rebalancing was needed to avoid bias.

  19. 19

    Why was the 'from_logits' parameter set to True in the binary cross-entropy loss?

    1. A

      Because the optimizer required logits as input

    2. B

      Because the final layer did not apply a sigmoid activation, so the loss function expects raw logits

    3. C

      Because the model output was already normalized between 0 and 1

    4. D

      Because the labels were not one-hot encoded

    Correct answer
    B

    Because the final layer did not apply a sigmoid activation, so the loss function expects raw logits

    Explanation

    Since the output layer had no activation, the model outputs logits (unscaled values), and from_logits=True tells the loss function to apply the sigmoid internally.

  20. 20

    What is the purpose of the 'cache' operation in the TensorFlow data pipeline?

    1. A

      To store the dataset in memory or local storage for faster access during training

    2. B

      To batch the data into groups of a specified size

    3. C

      To prefetch the next batch while the model is training

    4. D

      To shuffle the dataset randomly each epoch

    Correct answer
    A

    To store the dataset in memory or local storage for faster access during training

    Explanation

    Caching saves the dataset after preprocessing so that operations like file opening are not repeated each epoch, speeding up training.

Question 1 of 20
Question 1 of 20

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent