Building Keras Models
- 28Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
28 questions
- 1In 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
- 2In 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
- 3In 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
- 4With 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
- 5The 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
- 6When 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
- 7The 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
- 8A scalar (single number) is a tensor of rank_____.
Hint
Rank indicates the number of dimensions. A scalar has zero dimensions.
Answer
0
- 9A 28x28 grayscale image is represented as a tensor of rank_____.
Hint
It's a table of numbers with height and width dimensions.
Answer
2
- 10A 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
- 11TensorFlow automatically calculates gradients using_____.
Hint
This feature eliminates the need to manually derive the chain rule.
Answer
automatic differentiation
- 12Keras 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
- 13Categorical variables in neural networks are typically converted to numeric form using_____encoding.
Hint
This creates binary columns for each category level.
Answer
one-hot
- 14Standardization 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
- 15The data should be split into training and test sets_____performing standardization.
Hint
This prevents information from the test set from influencing preprocessing.
Answer
before
- 16For 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
- 17For 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
- 18The optimizer recommended as a default for neural networks is_____.
Hint
It is an adaptive variant of stochastic gradient descent.
Answer
Adam
- 19The 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
- 20After 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
- 21The 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
- 22The intensity of a grayscale pixel is represented by an integer between 0 and_____.
Hint
This range corresponds to an 8-bit representation.
Answer
255
- 23A color image uses three color channels: red, green, and_____.
Hint
This is abbreviated as RGB.
Answer
blue
- 24The 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
- 25To 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
- 26For 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
- 27When 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
- 28The fashion-mnist dataset contains 60,000 training images and_____test images.
Hint
The total dataset has 70,000 images.
Answer
10,000

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