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. Managing databases
B. Writing operating systems
C. Building deep learning models
D. Editing images

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

Keras installation Easy
A. install keras
B. pip install keras
C. python add 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. Cluster
C. Sequential
D. Pipeline

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

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

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

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

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

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

7 What does MLP stand for?

Multi-layer Perceptron learning for classification Easy
A. Multi-layer Perceptron
B. Matrix Label Predictor
C. Multiple Linear Pipeline
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. Softplus
B. Sigmoid
C. Tanh
D. ReLU

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

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

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

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

11 What is a common first step in text classification?

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

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

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

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 uses too much memory
D. The model learns the training data too well

14 What is a common method to reduce overfitting?

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

15 Why do we save a trained Keras model?

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

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

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

17 What is a hyperparameter?

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

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. AI and deep learning workloads
B. Word processing
C. Web browsing
D. Video playback

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

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

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 Dataset, Iterator, and TensorSpec classes
B. The fit(), evaluate(), and predict() methods
C. The Device, Graph, and Session utilities
D. The GradientTape, Variable, and Module classes

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 tensorflow, followed by from tensorflow import keras
C. pip install numpy, followed by import numpy.keras
D. pip install pytorch, followed by from pytorch import 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 Sequential model with only one input tensor
D. A callback that concatenates inputs after training

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. 2144 parameters
B. 2080 parameters
C. 2048 parameters
D. 2112 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="linear") with mean squared error
B. Dense(1, activation="sigmoid") with binary cross-entropy
C. Dense(1, activation="softmax") with categorical cross-entropy
D. Dense(2, activation="relu") with sparse cross-entropy

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 regression target values
B. The combined training and test data
C. Only the validation feature data
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. One sigmoid unit with mean squared error
B. Five linear units with binary cross-entropy
C. One softmax unit with categorical cross-entropy
D. Five softmax units with sparse 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. (128, 3, 128)
B. (128, 128, 3)
C. (1, 128, 128)
D. (3, 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. Apply random flips and rotations during training
B. Replace convolutional layers with linear outputs
C. Remove the validation dataset during training
D. Increase every image's pixel values after testing

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 Dropout(..., noise_shape=None)
C. Use Dense(..., use_bias=False)
D. Use Flatten(..., data_format="channels_last")

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 softmax units with categorical cross-entropy
C. One linear unit with mean squared error
D. Four sigmoid units with mean absolute error

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 validation data becomes training data
D. The optimizer stops updating after epoch 12

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 the output of model.summary()
B. Save the dataset using model.get_config()
C. Save the model using model.save("model.keras")
D. Save only predictions using numpy.save()

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 largest gradient values
B. Select the rate with the best validation performance
C. Select the rate using the final test accuracy
D. Select the rate with the lowest training loss

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. Managing email and calendar notifications
B. Running a lightweight command-line calculator
C. Training a large GPU-accelerated deep learning model
D. Editing a short document with basic formatting

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 performs training entirely through external web browsers
B. It replaces GPU computation with low-power mobile processors
C. It combines a workstation form factor with integrated AI hardware
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. Ethernet keyboard device communication
B. NVLink high-speed GPU interconnection
C. USB peripheral device communication
D. SATA disk controller 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 motherboard diagnostic utility
B. NVIDIA NGC container catalog
C. A generic CPU firmware archive
D. A desktop wallpaper repository

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 git version controller
B. The pip package manager
C. The nvidia-smi monitor
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. Package models and dependencies in portable GPU containers
B. Rewrite every model using a spreadsheet application
C. Store all dependencies only in developer shell history
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. Only the gradient from the first encoder call is used because a layer can have one inbound path.
B. Keras clones the encoder weights for each input, but synchronizes the clones after every epoch.
C. The encoder weights remain shared during inference but are automatically separated into branch-specific weights during training.
D. The encoder has one shared set of weights, and gradient contributions from both branches update those weights.

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. Import Keras first and then assign keras.backend = "jax".
C. Install TensorFlow because every Keras backend is executed through TensorFlow.
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 as a local tensor in call() and manually differentiate it.
B. Continue creating the matrix inside call(), but assign a globally unique name on every invocation so that Keras can distinguish all copies.
C. Create the matrix in compile() because compilation owns all trainable state.
D. Create the matrix with add_weight() in build() using the input shape.

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. CategoricalCrossentropy(from_logits=False)
B. SparseCategoricalCrossentropy(from_logits=True)
C. BinaryCrossentropy(from_logits=True)
D. MeanSquaredError() after converting labels to integers

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. Apply the backbone's required preprocessing identically during training and inference.
D. Unfreeze only the classification head so it can relearn the expected input distribution.

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.shuffle(...).map(random_augment).cache().batch(...).
B. Use dataset.map(random_augment).batch(...).cache().shuffle(...).
C. Use dataset.cache().shuffle(...).map(random_augment).batch(...).
D. Use dataset.map(random_augment).cache().repeat().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) → Lambda(simple_mean) → Dense
C. Embedding(mask_zero=True) → Flatten → 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. Vocabulary statistics leak validation information; adapt only on training text and reuse the resulting vocabulary.
B. The layer normalizes output probabilities; replace it with a trainable dense embedding.
C. Tokenization randomizes validation labels; adapt independently on every validation batch.
D. The layer learns model weights from labels; freeze it only after fitting the classifier.

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. Evaluate a clean training subset with training=False and compare it with validation evaluation.
C. 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.
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. Define the layer as an anonymous lambda so its Python closure is stored automatically.
B. Override call() to return the constructor arguments together with the output tensor.
C. Register the layer as serializable and implement get_config() for its constructor arguments.
D. Save only the layer weights because architecture metadata is inferred from tensor shapes.

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. Average the training and validation scores for every trial.
B. Select the model with the lowest training loss and omit validation.
C. Use the test set as the tuner objective but hide its labels from the model inputs.
D. Reserve an untouched test set for one final evaluation after tuning.

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. Disable the relevant MIG partitions and launch the job across full GPUs.
B. Keep MIG enabled because every instance automatically receives all NVLink bandwidth.
C. Move model parameters into CPU memory so separate MIG instances share one address space.
D. Merge active MIG instances so they appear as one unified-memory GPU.

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. Running data-center-class AI development locally with an integrated GPU software stack.
D. Replacing distributed storage with GPU memory for permanent archival workloads.

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 is available only for CPU-to-GPU transfers and cannot carry GPU-to-GPU traffic.
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 combines all connected GPUs into one device automatically when Keras is imported.

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 must install every Python package already present inside the container.
B. The host NVIDIA driver must support the CUDA version required by the container.
C. 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.
D. The host and container must use byte-for-byte identical Linux filesystems.

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. Disable CUDA graphs because they determine the GPU's compute capability.
B. Convert the operation to double precision so the driver can translate its architecture.
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. Disable workload monitoring because dynamic scheduling is effective only when utilization metrics are unavailable.
B. Place every workload in one process so GPU memory becomes globally shared without coordination.
C. Assign one CUDA thread to each team because CUDA threads provide operating-system-level isolation.
D. Use MIG and containers for compatible workloads, while scheduling full GPUs for tightly coupled training jobs.