1. Home
  2. Explore
  3. Computer Science
  4. Building Keras Models

Study methods

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

Building Keras Models

  • 28Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Training Fundamentals
In training a neural network, the function that measures the discrepancy between predictions and true values is called the
function.

28 questions

  1. 1
    In training a neural network, the function that measures the discrepancy between predictions and true values is called the
    _____
    function.
    Hint

    Think about what we minimize during training to improve the model.

    Answer

    loss

  2. 2
    In gradient descent, the entire training dataset is used to compute the gradient before updating weights once per
    _____
    .
    Hint

    Consider the term for one complete pass through the training data.

    Answer

    epoch

  3. 3
    In stochastic gradient descent, the training data is divided into small groups called
    _____
    .
    Hint

    These are smaller subsets of data used for each gradient update.

    Answer

    batches

  4. 4
    With a training set of 194 samples and a batch size of 32, the number of batches per epoch is
    _____
    .
    Hint

    Divide the number of samples by the batch size and round up.

    Answer

    7

  5. 5
    The advantage of stochastic gradient descent (SGD) over gradient descent is that it allows for more frequent weight updates and requires less
    _____
    .
    Hint

    Think about the resources needed to process the entire dataset at once.

    Answer

    compute

  6. 6
    When validation loss starts to increase while training loss continues to decrease, the model is
    _____
    .
    Hint

    This happens when the model memorizes training data rather than learning general patterns.

    Answer

    overfitting

  7. 7
    The regularization technique that stops training when validation performance stops improving is called
    _____
    .
    Hint

    It's described as a 'beautiful free lunch' by Geoff Hinton.

    Answer

    early stopping

  8. 8
    A scalar (single number) is a tensor of rank
    _____
    .
    Hint

    Rank indicates the number of dimensions. A scalar has zero dimensions.

    Answer

    0

  9. 9
    A 28x28 grayscale image is represented as a tensor of rank
    _____
    .
    Hint

    It's a table of numbers with height and width dimensions.

    Answer

    2

  10. 10
    A color video with frames of size 1920x1080 is a tensor of rank
    _____
    .
    Hint

    Consider the dimensions: time (frames), height, width, and color channels.

    Answer

    4

  11. 11
    TensorFlow automatically calculates gradients using
    _____
    .
    Hint

    This feature eliminates the need to manually derive the chain rule.

    Answer

    automatic differentiation

  12. 12
    Keras provides high-level features such as the notion of a
    _____
    and activation functions.
    Hint

    This abstraction represents a collection of neurons with a specific transformation.

    Answer

    layer

  13. 13
    Categorical variables in neural networks are typically converted to numeric form using
    _____
    encoding.
    Hint

    This creates binary columns for each category level.

    Answer

    one-hot

  14. 14
    Standardization of numeric variables involves subtracting the mean and dividing by the
    _____
    .
    Hint

    This gives the variable a mean of 0 and a standard deviation of 1.

    Answer

    standard deviation

  15. 15
    The data should be split into training and test sets
    _____
    performing standardization.
    Hint

    This prevents information from the test set from influencing preprocessing.

    Answer

    before

  16. 16
    For the heart disease model, the input layer has
    _____
    neurons because the data has 29 features.
    Hint

    The number of input neurons equals the number of features after preprocessing.

    Answer

    29

  17. 17
    For binary classification with a sigmoid output, the appropriate loss function is
    _____
    .
    Hint

    It measures the difference between two probability distributions (true and predicted).

    Answer

    binary cross-entropy

  18. 18
    The optimizer recommended as a default for neural networks is
    _____
    .
    Hint

    It is an adaptive variant of stochastic gradient descent.

    Answer

    Adam

  19. 19
    The Keras method used to train a model is
    _____
    .
    Hint

    This function takes the training data, number of epochs, batch size, and validation split.

    Answer

    model.fit

  20. 20
    After training, model performance on unseen data is evaluated using the function
    _____
    .
    Hint

    This function computes loss and metrics on a test dataset.

    Answer

    model.evaluate

  21. 21
    The heart disease model achieved an accuracy of
    _____
    % on the test set.
    Hint

    This was better than the baseline of always predicting the majority class.

    Answer

    83.6

  22. 22
    The intensity of a grayscale pixel is represented by an integer between 0 and
    _____
    .
    Hint

    This range corresponds to an 8-bit representation.

    Answer

    255

  23. 23
    A color image uses three color channels: red, green, and
    _____
    .
    Hint

    This is abbreviated as RGB.

    Answer

    blue

  24. 24
    The computer vision task that assigns a class label to every pixel in an image is called semantic
    _____
    .
    Hint

    This produces a pixel-wise classification map.

    Answer

    segmentation

  25. 25
    To convert a 28x28 image into a vector for a dense neural network, we use a flattening layer that produces a vector of length
    _____
    .
    Hint

    Multiply the image dimensions: 28 × 28.

    Answer

    784

  26. 26
    For multi-class classification with mutually exclusive classes, the output layer should use the
    _____
    activation function.
    Hint

    This function ensures outputs are probabilities that sum to 1.

    Answer

    softmax

  27. 27
    When the labels are provided as integers (e.g., 0 to 9), the appropriate loss function is
    _____
    .
    Hint

    This is a variant of categorical cross-entropy for integer labels.

    Answer

    sparse categorical cross-entropy

  28. 28
    The fashion-mnist dataset contains 60,000 training images and
    _____
    test images.
    Hint

    The total dataset has 70,000 images.

    Answer

    10,000

1 of 28
Question 1 of 28

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent