Unit 2: Building Models with Keras - Practice Quiz

INT422 — Deep Learning 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is Keras mainly used for?

Introduction to Keras Easy
A. Editing images
B. Building deep learning models
C. Managing databases
D. Writing operating systems

2 Which command is commonly used to install Keras with pip?

Keras installation Easy
A. pip install keras
B. python add keras
C. install keras
D. pip get keras

3 Which Keras class is often used to build a model layer by layer?

Keras layers and models Easy
A. Dataset
B. Pipeline
C. Sequential
D. Cluster

4 What does a dense layer do in a neural network?

Keras layers and models Easy
A. Normalizes text data
B. Connects every input to every neuron
C. Splits the dataset
D. Stores image files

5 What type of output is usually produced by a regression model?

Building a regression model Easy
A. A cluster id
B. A text sentence
C. A class label
D. A numeric value

6 Which loss function is commonly used for regression in Keras?

Building a regression model Easy
A. Categorical crossentropy
B. Binary accuracy
C. Hinge loss
D. Mean squared error

7 What does MLP stand for?

Multi-layer Perceptron learning for classification Easy
A. Multiple Linear Pipeline
B. Matrix Label Predictor
C. Multi-layer Perceptron
D. Model Learning Process

8 For a binary classification task, what activation is often used in the output layer?

Multi-layer Perceptron learning for classification Easy
A. Sigmoid
B. ReLU
C. Softplus
D. Tanh

9 What kind of data is image classification designed to predict?

Image classification with Keras Easy
A. A database record
B. A stock price
C. A time interval
D. An image category

10 Which layer is commonly used to work with image data in Keras models?

Image classification with Keras Easy
A. Normalization table
B. Recurrent layer
C. Convolutional layer
D. Embedding layer

11 What is a common first step in text classification?

Building a text classification model Easy
A. Delete all punctuation only
B. Convert text into numbers
C. Draw the text as an image
D. Sort words alphabetically

12 Which Keras layer is often used to turn word indices into dense vectors?

Building a text classification model Easy
A. Dropout
B. Flatten
C. MaxPooling
D. Embedding

13 What does overfitting mean?

Overfitting and underfitting Easy
A. The model cannot learn any pattern
B. The model trains too quickly
C. The model learns the training data too well
D. The model uses too much memory

14 What is a common method to reduce overfitting?

Overfitting and underfitting Easy
A. Removing labels
B. Using a larger file
C. Increasing noise
D. Dropout

15 Why do we save a trained Keras model?

Saving and loading a model Easy
A. To reuse it later
B. To change the dataset
C. To make training slower
D. To erase its weights

16 Which function is used to load a saved Keras model?

Saving and loading a model Easy
A. load_model()
B. read_model()
C. get_model()
D. open_model()

17 What is a hyperparameter?

Hyperparameter tuning Easy
A. A setting chosen before training
B. A type of activation output
C. A label in the dataset
D. A weight learned by the model

18 Which of the following is a hyperparameter?

Hyperparameter tuning Easy
A. Weight update
B. Learning rate
C. Prediction
D. Accuracy

19 What is NVIDIA DGX Station A100 primarily designed for?

Introduction to NVIDIA DGX Station A100 Easy
A. Web browsing
B. Video playback
C. AI and deep learning workloads
D. Word processing

20 Which component is a key part of the DGX Station A100 hardware architecture?

Hardware Architecture Easy
A. A100 GPUs
B. DVD drives
C. Touchpads
D. Inkjet printers

21 A developer wants to train, validate, and generate predictions from a neural network without manually writing the complete training loop. Which Keras feature most directly supports this requirement?

Introduction to Keras Medium
A. The Device, Graph, and Session utilities
B. The GradientTape, Variable, and Module classes
C. The Dataset, Iterator, and TensorSpec classes
D. The fit(), evaluate(), and predict() methods

22 A student wants to use TensorFlow-backed Keras in a new Python virtual environment. Which installation and import combination is most appropriate?

Keras installation Medium
A. pip install cuda, followed by from cuda import keras
B. pip install pytorch, followed by from pytorch import keras
C. pip install tensorflow, followed by from tensorflow import keras
D. pip install numpy, followed by import numpy.keras

23 A neural network must accept an image and a metadata vector as separate inputs before combining them. Which Keras model-building approach is most suitable?

Keras layers and models Medium
A. A Functional API model with multiple input tensors
B. A single Dense layer with no input declaration
C. A callback that concatenates inputs after training
D. A Sequential model with only one input tensor

24 A Dense layer has 32 input features and 64 output units, with one bias per output unit. How many trainable parameters does it contain?

Keras layers and models Medium
A. 2048 parameters
B. 2144 parameters
C. 2112 parameters
D. 2080 parameters

25 A Keras model predicts unrestricted real-valued house prices. Which output layer and loss function are most appropriate?

Building a regression model Medium
A. Dense(1, activation="sigmoid") with binary cross-entropy
B. Dense(2, activation="relu") with sparse cross-entropy
C. Dense(1, activation="softmax") with categorical cross-entropy
D. Dense(1, activation="linear") with mean squared error

26 Before training a regression model, a normalization layer must learn the mean and variance of each feature. Which data should be passed to the layer's adapt() method?

Building a regression model Medium
A. Only the validation feature data
B. The combined training and test data
C. Only the regression target values
D. Only the training feature data

27 An MLP classifies samples into five mutually exclusive classes, and the labels are integers from 0 to 4. Which configuration is appropriate for the output layer and loss?

Multi-layer Perceptron learning for classification Medium
A. Five linear units with binary cross-entropy
B. Five softmax units with sparse categorical cross-entropy
C. One sigmoid unit with mean squared error
D. One softmax unit with categorical cross-entropy

28 A Conv2D layer receives an RGB image represented as a single sample using Keras's default channels-last format. Which input shape should be specified for a image?

Image classification with Keras Medium
A. (3, 128, 128)
B. (128, 3, 128)
C. (128, 128, 3)
D. (1, 128, 128)

29 A small image dataset causes a CNN to memorize training images. Which Keras strategy can increase input diversity without permanently creating additional image files?

Image classification with Keras Medium
A. Increase every image's pixel values after testing
B. Remove the validation dataset during training
C. Replace convolutional layers with linear outputs
D. Apply random flips and rotations during training

30 Text sequences in a batch are padded with zeros to obtain equal lengths. Which configuration helps an embedding-based model ignore those padding positions?

Building a text classification model Medium
A. Use Embedding(..., mask_zero=True)
B. Use Dense(..., use_bias=False)
C. Use Flatten(..., data_format="channels_last")
D. Use Dropout(..., noise_shape=None)

31 A text classifier assigns each document to exactly one of four categories, and the targets are one-hot encoded. Which final layer and loss should be used?

Building a text classification model Medium
A. One sigmoid unit with sparse cross-entropy
B. Four sigmoid units with mean absolute error
C. One linear unit with mean squared error
D. Four softmax units with categorical cross-entropy

32 During training, the training loss keeps decreasing, but the validation loss begins increasing after epoch 12. What does this pattern most strongly indicate?

Overfitting and underfitting Medium
A. The model remains underfitted after epoch 12
B. The model starts overfitting after epoch 12
C. The optimizer stops updating after epoch 12
D. The validation data becomes training data

33 A developer wants to save a trained Keras model so that its architecture, weights, and optimizer state can later be restored together. Which approach is most appropriate?

Saving and loading a model Medium
A. Save only predictions using numpy.save()
B. Save the model using model.save("model.keras")
C. Save the dataset using model.get_config()
D. Save only the output of model.summary()

34 A tuner is comparing learning rates of , , and . Which evaluation procedure best avoids optimistic bias?

Hyperparameter tuning Medium
A. Select the rate with the best validation performance
B. Select the rate with the largest gradient values
C. Select the rate with the lowest training loss
D. Select the rate using the final test accuracy

35 Which workload is the strongest match for an NVIDIA DGX Station A100 rather than a conventional office workstation?

NVIDIA DGX Station A100 Medium
A. Running a lightweight command-line calculator
B. Editing a short document with basic formatting
C. Managing email and calendar notifications
D. Training a large GPU-accelerated deep learning model

36 A research team needs data-center-class AI computing in a local office without installing a full server rack. Why is DGX Station A100 suitable?

Introduction to NVIDIA DGX Station A100 Medium
A. It combines a workstation form factor with integrated AI hardware
B. It performs training entirely through external web browsers
C. It replaces GPU computation with low-power mobile processors
D. It provides storage capacity but no local computation

37 A model is distributed across the multiple A100 GPUs in a DGX Station A100 and frequently transfers tensors between GPUs. Which hardware feature primarily accelerates these transfers?

Hardware Architecture Medium
A. NVLink high-speed GPU interconnection
B. SATA disk controller communication
C. Ethernet keyboard device communication
D. USB peripheral device communication

38 A team wants a tested container containing a deep learning framework and GPU-optimized dependencies for DGX Station A100. Which NVIDIA resource is most appropriate?

DGX Station A100 Software Stack Medium
A. A generic CPU firmware archive
B. A desktop wallpaper repository
C. A motherboard diagnostic utility
D. NVIDIA NGC container catalog

39 A developer needs to compile a custom CUDA kernel for use in a deep learning operation. Which CUDA Toolkit component performs the CUDA source compilation?

CUDA Toolkit Medium
A. The nvidia-smi monitor
B. The git version controller
C. The pip package manager
D. The nvcc compiler

40 A company prototypes models locally on DGX Station A100 and later moves them to larger NVIDIA-based infrastructure. Which practice best supports this scaling path?

Future of AI with DGX Station A100 Medium
A. Store all dependencies only in developer shell history
B. Rewrite every model using a spreadsheet application
C. Package models and dependencies in portable GPU containers
D. Convert GPU operations into manual CPU calculations

41 A Keras Functional model applies the same encoder instance to two different inputs and then combines the resulting embeddings. Which statement correctly describes training behavior?

Introduction to Keras Hard
A. The encoder has one shared set of weights, and gradient contributions from both branches update those weights.
B. Only the gradient from the first encoder call is used because a layer can have one inbound path.
C. Keras clones the encoder weights for each input, but synchronizes the clones after every epoch.
D. The encoder weights remain shared during inference but are automatically separated into branch-specific weights during training.

42 A developer installs Keras 3 in a fresh environment and wants to run it with the JAX backend rather than TensorFlow. Which setup is correct?

Keras installation Hard
A. Install only the keras package because it contains complete copies of TensorFlow, JAX, and PyTorch together with their GPU runtimes.
B. Install TensorFlow because every Keras backend is executed through TensorFlow.
C. Import Keras first and then assign keras.backend = "jax".
D. Install JAX and set KERAS_BACKEND=jax before importing Keras.

43 A two-output Keras model is compiled with losses and , loss weights and , and several layer regularizers producing penalties . Ignoring metric values, what objective is minimized?

Keras layers and models Hard
A.
B.
C.
D.

44 A subclassed Keras layer creates a new trainable matrix inside call() every time it receives an input. This causes state-creation and tracing errors. What is the most appropriate redesign?

Keras layers and models Hard
A. Create the matrix in compile() because compilation owns all trainable state.
B. Create the matrix as a local tensor in call() and manually differentiate it.
C. Create the matrix with add_weight() in build() using the input shape.
D. Continue creating the matrix inside call(), but assign a globally unique name on every invocation so that Keras can distinguish all copies.

45 Regression targets are standardized as , where . A model achieves an MSE of in standardized target space. What is its MSE after predictions are converted back to the original units?

Building a regression model Hard
A.
B.
C.
D.

46 A regression network models heteroscedastic Gaussian noise by outputting a mean and . Ignoring constants, which per-example loss is the Gaussian negative log-likelihood?

Building a regression model Hard
A.
B.
C.
D.

47 An MLP performs three-class classification with integer labels in . Its output layer returns three unrestricted values with no activation. Which loss configuration is mathematically consistent and numerically stable?

Multi-layer Perceptron learning for classification Hard
A. BinaryCrossentropy(from_logits=True)
B. MeanSquaredError() after converting labels to integers
C. SparseCategoricalCrossentropy(from_logits=True)
D. CategoricalCrossentropy(from_logits=False)

48 A pretrained image backbone is frozen, but validation accuracy is unexpectedly poor. The new dataset is supplied in , whereas the backbone was trained with a different normalization convention. What is the best correction?

Image classification with Keras Hard
A. Increase image augmentation until its output approximates the original normalization.
B. Replace categorical cross-entropy with MSE because MSE is insensitive to input scaling.
C. Unfreeze only the classification head so it can relearn the expected input distribution.
D. Apply the backbone's required preprocessing identically during training and inference.

49 An input pipeline is ordered as dataset.map(random_augment).cache().shuffle(...).batch(...). After the first epoch, each image receives the same augmentation repeatedly. Which change preserves caching while generating fresh stochastic augmentations?

Image classification with Keras Hard
A. Use dataset.map(random_augment).batch(...).cache().shuffle(...).
B. Use dataset.map(random_augment).cache().repeat().batch(...).
C. Use dataset.shuffle(...).map(random_augment).cache().batch(...).
D. Use dataset.cache().shuffle(...).map(random_augment).batch(...).

50 Sequences are padded with token ID 0, and Embedding(mask_zero=True) is used. Which architecture can automatically exclude padding positions when aggregating sequence features?

Building a text classification model Hard
A. Embedding(mask_zero=True) → GlobalAveragePooling1D → Dense
B. Embedding(mask_zero=True) → Flatten → Dense
C. Embedding(mask_zero=True) → Lambda(simple_mean) → Dense
D. Embedding(mask_zero=True) → Conv1D → GlobalMaxPooling1D

51 A TextVectorization layer is adapted on the entire corpus before the data is split. Why can this make the reported validation result optimistic, and what is the correct procedure?

Building a text classification model Hard
A. The layer learns model weights from labels; freeze it only after fitting the classifier.
B. The layer normalizes output probabilities; replace it with a trainable dense embedding.
C. Vocabulary statistics leak validation information; adapt only on training text and reuse the resulting vocabulary.
D. Tokenization randomizes validation labels; adapt independently on every validation batch.

52 During fit(), training loss is consistently higher than validation loss. The model uses strong data augmentation and dropout. Which diagnostic best determines whether this is an artifact of different execution conditions rather than underfitting?

Overfitting and underfitting Hard
A. Double the network depth until the training-mode loss becomes lower than validation loss.
B. Train for many additional epochs while retaining dropout and augmentation, because training loss must eventually become lower than validation loss in every correctly configured model.
C. Evaluate a clean training subset with training=False and compare it with validation evaluation.
D. Remove the validation set because its lower loss proves that it contains easier labels.

53 A model containing a custom layer must be saved in the native Keras format and loaded without passing a custom_objects dictionary. Which implementation is most appropriate?

Saving and loading a model Hard
A. Register the layer as serializable and implement get_config() for its constructor arguments.
B. Define the layer as an anonymous lambda so its Python closure is stored automatically.
C. Save only the layer weights because architecture metadata is inferred from tensor shapes.
D. Override call() to return the constructor arguments together with the output tensor.

54 Hundreds of hyperparameter configurations are compared on the same validation set, and the best one is reported using that validation score. What is the strongest evaluation design for reducing selection bias?

Hyperparameter tuning Hard
A. Use the test set as the tuner objective but hide its labels from the model inputs.
B. Average the training and validation scores for every trial.
C. Reserve an untouched test set for one final evaluation after tuning.
D. Select the model with the lowest training loss and omit validation.

55 A DGX Station A100 has its GPUs partitioned into Multi-Instance GPU instances for several independent users. A new job requires the maximum resources of complete GPUs and high-bandwidth multi-GPU communication. What should the administrator do?

NVIDIA DGX Station A100 Hard
A. Keep MIG enabled because every instance automatically receives all NVLink bandwidth.
B. Merge active MIG instances so they appear as one unified-memory GPU.
C. Move model parameters into CPU memory so separate MIG instances share one address space.
D. Disable the relevant MIG partitions and launch the job across full GPUs.

56 Which use case most directly reflects the purpose of the NVIDIA DGX Station A100?

Introduction to NVIDIA DGX Station A100 Hard
A. Providing a CPU-only workstation whose primary advantage is compatibility with non-GPU code.
B. Executing only graphics-rendering applications without CUDA or AI frameworks.
C. Replacing distributed storage with GPU memory for permanent archival workloads.
D. Running data-center-class AI development locally with an integrated GPU software stack.

57 A model is placed on multiple A100 GPUs connected by NVLink, but a single-GPU Keras script still uses only one GPU. Which statement best explains this result?

Hardware Architecture Hard
A. NVLink combines all connected GPUs into one device automatically when Keras is imported.
B. Multiple GPUs are activated only when the model has more parameters than one GPU can store.
C. NVLink accelerates peer communication, but software must explicitly use a multi-GPU distribution strategy.
D. NVLink is available only for CPU-to-GPU transfers and cannot carry GPU-to-GPU traffic.

58 A CUDA-enabled NGC container includes its own user-space CUDA libraries. What host-side compatibility condition is still essential on a DGX Station A100?

DGX Station A100 Software Stack Hard
A. The host and container must use byte-for-byte identical Linux filesystems.
B. The host must install every Python package already present inside the container.
C. The host NVIDIA driver must support the CUDA version required by the container.
D. The container must replace the host GPU driver at startup and restore the original driver when the process exits, because containers cannot access host drivers directly.

59 A custom CUDA operation built for older GPUs fails on an A100 with no kernel image is available for execution on the device. What is the most direct build-level remedy?

CUDA Toolkit Hard
A. Convert the operation to double precision so the driver can translate its architecture.
B. Disable CUDA graphs because they determine the GPU's compute capability.
C. Recompile only for sm_70 because all Tensor Core GPUs use the same binary.
D. Recompile with code generation for sm_80 or compatible compute_80 PTX.

60 An organization wants future AI workloads to share a DGX Station efficiently while preserving isolation between teams. Which strategy is most technically sound?

Future of AI with DGX Station A100 Hard
A. Place every workload in one process so GPU memory becomes globally shared without coordination.
B. Use MIG and containers for compatible workloads, while scheduling full GPUs for tightly coupled training jobs.
C. Disable workload monitoring because dynamic scheduling is effective only when utilization metrics are unavailable.
D. Assign one CUDA thread to each team because CUDA threads provide operating-system-level isolation.