Deep Learning for Computer Vision
- 73Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is a tensor in TensorFlow?
What is a tensor in TensorFlow?
73 questions
- 1
What is a tensor in TensorFlow?
- A
A data structure only used for images
- B
A multi-dimensional array that is the core data structure in TensorFlow
- C
A 2-dimensional array of numbers
- D
A one-dimensional vector of numbers
Correct answer
BA multi-dimensional array that is the core data structure in TensorFlow
Explanation
Tensors are multi-dimensional arrays (0D scalar, 1D vector, 2D matrix, etc.) and are the core data structure in TensorFlow.
- A
- 2
Which TensorFlow function is used to create a constant tensor?
- A
tf.variable
- B
tf.tensor
- C
tf.create
- D
tf.constant
Correct answer
Dtf.constant
Explanation
tf.constant is used to create a constant tensor with a fixed value.
- A
- 3
How can you create a tensor of all ones with shape (3, 4)?
- A
tf.eye(3, 4)
- B
tf.constant(1, shape=(3, 4))
- C
tf.fill(dims=(3, 4), value=1)
- D
tf.ones(shape=(3, 4))
Correct answer
Dtf.ones(shape=(3, 4))
Explanation
tf.ones creates a tensor of all ones with the specified shape.
- A
- 4
What does the shape of a tensor represent?
- A
The number of dimensions and the size of each dimension
- B
The data type of the tensor elements
- C
The number of elements in the tensor
- D
The rank of the tensor only
Correct answer
AThe number of dimensions and the size of each dimension
Explanation
Shape specifies the number of dimensions and the size of each dimension.
- A
- 5
Given a 2D tensor
twith shape (3,4), how do you slice the first two rows and all columns?- A
t[0:2, 0:4]
- B
t[0:2]
- C
t[0:2, :]
- D
t[:2, :]
Correct answer
Ct[0:2, :]
Explanation
Slicing uses start:stop for each dimension; t[0:2, :] selects rows 0 and 1 and all columns.
- A
- 6
What does broadcasting allow in TensorFlow?
- A
Creating multiple tensors simultaneously
- B
Converting tensors to numpy arrays automatically
- C
Performing operations on tensors of different shapes by automatically expanding dimensions
- D
Sending tensor data over a network
Correct answer
CPerforming operations on tensors of different shapes by automatically expanding dimensions
Explanation
Broadcasting enables element-wise operations on tensors with different shapes by virtually replicating smaller tensors.
- A
- 7
Which operation performs matrix multiplication in TensorFlow?
- A
tf.matmul
- B
tf.multiply
- C
tf.dot
- D
tf.linalg.matmul
Correct answer
Dtf.linalg.matmul
Explanation
tf.linalg.matmul is used for matrix multiplication. (In practice, tf.matmul is also an alias, but the documented function is tf.linalg.matmul.)
- A
- 8
What is a ragged tensor used for?
- A
Tensors with string data
- B
Tensors with many zero elements
- C
Tensors that are only partially initialized
- D
Tensors with varying lengths along one dimension
Correct answer
DTensors with varying lengths along one dimension
Explanation
Ragged tensors handle non-rectangular data where rows may have different lengths.
- A
- 9
Which method on a tf.Variable updates its value by adding a specified value?
- A
update
- B
add
- C
assign
- D
assign_add
Correct answer
Dassign_add
Explanation
assign_add performs an in-place addition to the variable's current value.
- A
- 10
What does
tf.castdo?- A
Performs a mathematical operation
- B
Converts a tensor to a different data type
- C
Creates a new tensor from a list
- D
Reshapes a tensor
Correct answer
BConverts a tensor to a different data type
Explanation
tf.cast changes the data type of a tensor, e.g., from int32 to float32.
- A
- 11
In the linear regression model for car price prediction, what is the purpose of the Normalization layer?
- A
To add noise to the data
- B
To normalize input features to have mean 0 and variance 1
- C
To convert categorical data to numerical
- D
To reduce the number of features
Correct answer
BTo normalize input features to have mean 0 and variance 1
Explanation
The Normalization layer scales features to zero mean and unit variance, which helps training.
- A
- 12
What does the Dense layer implement?
- A
Y = activation(W * X + B)
- B
Y = W * X + B
- C
Y = X^2
- D
Y = max(0, X)
Correct answer
BY = W * X + B
Explanation
A Dense layer computes Y = W*X + B (linear transformation) before an optional activation.
- A
- 13
Which loss function is most robust to outliers in regression?
- A
Mean Squared Error
- B
Mean Absolute Error
- C
Binary Cross-Entropy
- D
Huber Loss
Correct answer
BMean Absolute Error
Explanation
MAE treats all errors linearly, so it is less sensitive to outliers than MSE.
- A
- 14
What is the effect of a very high learning rate in gradient descent?
- A
Slow convergence
- B
Oscillation or divergence
- C
Faster convergence to optimal solution
- D
No effect on training
Correct answer
BOscillation or divergence
Explanation
A high learning rate can cause the loss to oscillate or diverge.
- A
- 15
In the machine learning lifecycle, what is the purpose of the validation set?
- A
Final evaluation of model performance
- B
Tuning model hyperparameters during development
- C
Training the model
- D
Data augmentation
Correct answer
BTuning model hyperparameters during development
Explanation
The validation set is used during training to evaluate performance on unseen data and tune hyperparameters.
- A
- 16
Which optimizer combines the benefits of AdaGrad and RMSProp?
- A
SGD
- B
Adam
- C
RMSProp
- D
Adagrad
Correct answer
BAdam
Explanation
Adam (Adaptive Moment Estimation) combines AdaGrad's handling of sparse gradients and RMSProp's adaptation of learning rates.
- A
- 17
What does underfitting indicate about the model?
- A
The model performs well on both train and test sets
- B
The model is too complex and memorizes data
- C
The model is too simple to capture patterns in data
- D
The model has too many parameters
Correct answer
CThe model is too simple to capture patterns in data
Explanation
Underfitting occurs when the model cannot capture the underlying trend, often due to simplicity.
- A
- 18
Which method can help address underfitting in a neural network?
- A
Increasing dropout rate
- B
Adding more layers and neurons
- C
Reducing the number of training epochs
- D
Using a smaller learning rate
Correct answer
BAdding more layers and neurons
Explanation
Adding more layers or neurons increases model capacity to learn complex patterns.
- A
- 19
What is the shape of an image tensor in TensorFlow?
- A
(height, width, channels)
- B
(height, width)
- C
(channels, height, width)
- D
(batch, height, width, channels)
Correct answer
D(batch, height, width, channels)
Explanation
Images are typically represented as tensors of shape (batch_size, height, width, channels) in TensorFlow.
- A
- 20
What is the role of the kernel in a convolutional layer?
- A
To reduce the spatial dimensions of the input
- B
To slide over the input and produce a feature map
- C
To introduce non-linearity
- D
To normalize the output
Correct answer
BTo slide over the input and produce a feature map
Explanation
A kernel (filter) slides over the input and computes dot products to produce a feature map.
- A
- 21
What does the padding parameter 'same' in a convolutional layer do?
- A
Pads input so that output size equals input size
- B
Removes border pixels
- C
Adds zeros to the output
- D
No padding; output size may shrink
Correct answer
APads input so that output size equals input size
Explanation
With 'same' padding, the output spatial dimensions are the same as input (when stride=1) by adding zeros around the border.
- A
- 22
What is the purpose of a pooling layer?
- A
To introduce non-linearity
- B
To reduce spatial dimensions and extract dominant features
- C
To add more channels
- D
To increase spatial dimensions
Correct answer
BTo reduce spatial dimensions and extract dominant features
Explanation
Pooling downsamples the feature maps, reducing spatial size and making features more invariant to small translations.
- A
- 23
Which loss function is standard for binary classification?
- A
Mean Squared Error
- B
Hinge Loss
- C
Categorical Cross-Entropy
- D
Binary Cross-Entropy
Correct answer
DBinary Cross-Entropy
Explanation
Binary cross-entropy is used for two-class classification problems.
- A
- 24
Why is precision often more important than accuracy when class imbalance exists?
- A
Precision measures the proportion of true positives among positive predictions, which is more meaningful when negatives dominate
- B
Accuracy is not used in classification
- C
Precision and accuracy are identical
- D
Accuracy measures only true positives
Correct answer
APrecision measures the proportion of true positives among positive predictions, which is more meaningful when negatives dominate
Explanation
In imbalanced datasets, accuracy can be misleading; precision focuses on the correctness of positive predictions.
- A
- 25
What does the Flatten layer do in a CNN?
- A
Converts a 2D feature map into a 1D vector
- B
Reduces the number of channels
- C
Increases spatial dimensions
- D
Applies a non-linear activation
Correct answer
AConverts a 2D feature map into a 1D vector
Explanation
The Flatten layer reshapes the multi-dimensional output from convolutional/pooling layers into a 1D vector for fully connected layers.
- A
- 26
How can you save a trained Keras model to a file?
- A
model.save('model.h5')
- B
model.export('model.h5')
- C
model.save_model('model.h5')
- D
tf.saved_model.save(model, 'model.h5')
Correct answer
Amodel.save('model.h5')
Explanation
model.save('path') saves the entire model (architecture, weights, optimizer state) in HDF5 or SavedModel format.
- A
- 27
Which Keras model API allows creating models with multiple inputs and outputs?
- A
Functional API
- B
All of the above
- C
Sequential API
- D
Model Subclassing
Correct answer
AFunctional API
Explanation
The Functional API supports non-linear topologies like multiple inputs, multiple outputs, and shared layers.
- A
- 28
What is the purpose of
tf.GradientTape?- A
To compute gradients automatically during forward pass
- B
To create a computational graph
- C
To update model weights
- D
To record operations for automatic differentiation
Correct answer
DTo record operations for automatic differentiation
Explanation
GradientTape records operations for subsequent gradient computation.
- A
- 29
What does the
@tf.functiondecorator do?- A
Adds automatic differentiation to a function
- B
Creates a new layer
- C
Compiles a Python function into a TensorFlow graph for faster execution
- D
Converts a function to run in eager mode
Correct answer
CCompiles a Python function into a TensorFlow graph for faster execution
Explanation
tf.function traces the function and builds a computational graph, improving performance and portability.
- A
- 30
Which callback stops training when a monitored metric stops improving?
- A
EarlyStopping
- B
ModelCheckpoint
- C
ReduceLROnPlateau
- D
LearningRateScheduler
Correct answer
AEarlyStopping
Explanation
EarlyStopping monitors a metric (e.g., validation loss) and stops training if no improvement for a specified number of epochs.
- A
- 31
What is the purpose of the ModelCheckpoint callback?
- A
To stop training early
- B
To adjust the learning rate
- C
To save the model weights at specific intervals or when a metric improves
- D
To log training metrics for visualization
Correct answer
CTo save the model weights at specific intervals or when a metric improves
Explanation
ModelCheckpoint saves the model (or weights) periodically, often when validation performance improves.
- A
- 32
What does TensorBoard allow you to visualize?
- A
Training metrics, model graphs, and performance profiling
- B
Only hyperparameter tuning results
- C
Only loss curves
- D
Only the model architecture
Correct answer
ATraining metrics, model graphs, and performance profiling
Explanation
TensorBoard provides a suite of visualization tools for experiment tracking, including metrics, graphs, and profiling.
- A
- 33
What is Mixup data augmentation?
- A
Randomly erasing parts of an image
- B
Rotating images by random angles
- C
Flipping images horizontally
- D
Creating a new sample by mixing two images and their labels linearly
Correct answer
DCreating a new sample by mixing two images and their labels linearly
Explanation
Mixup creates a weighted combination of two images and their labels: new_x = lambda*x1 + (1-lambda)x2, new_y = lambday1 + (1-lambda)*y2.
- A
- 34
What is the primary benefit of using TensorFlow Records?
- A
Automatic data augmentation
- B
Support for only image data
- C
Increased model accuracy
- D
Efficient binary format for data storage and faster loading
Correct answer
DEfficient binary format for data storage and faster loading
Explanation
TFRecords are a binary format that allows efficient serialization and faster data pipeline performance.
- A
- 35
How can you create a custom metric in Keras?
- A
Both A and B
- B
By defining a function and passing it to model.compile
- C
Custom metrics are not supported
- D
By subclassing tf.keras.metrics.Metric
Correct answer
ABoth A and B
Explanation
Custom metrics can be functions or subclasses of Metric that implement update_state and result methods.
- A
- 36
What is overfitting in machine learning?
- A
Model performs equally well on all datasets
- B
Model has a high bias
- C
Model performs well on training data but poorly on unseen data
- D
Model is too simple to learn patterns
Correct answer
CModel performs well on training data but poorly on unseen data
Explanation
Overfitting occurs when the model learns noise in training data and fails to generalize.
- A
- 37
Which of the following is a common cause of overfitting?
- A
Too much training data
- B
Model is too complex for the amount of data
- C
Using dropout layers
- D
Using a very small learning rate
Correct answer
BModel is too complex for the amount of data
Explanation
Overfitting often happens when the model has too many parameters relative to the dataset size.
- A
- 38
How does data augmentation help prevent overfitting?
- A
By reducing the number of training examples
- B
By simplifying the data preprocessing
- C
By artificially increasing the diversity of training data
- D
By decreasing model complexity
Correct answer
CBy artificially increasing the diversity of training data
Explanation
Augmentation applies random transformations to create new training samples, making the model more robust.
- A
- 39
What does dropout do during training?
- A
Increases the learning rate
- B
Drops a fraction of neurons to reduce overfitting
- C
Adds noise to the labels
- D
Removes low-variance features
Correct answer
BDrops a fraction of neurons to reduce overfitting
Explanation
Dropout randomly sets a fraction of activations to zero, preventing co-adaptation and acting as regularization.
- A
- 40
What is L2 regularization?
- A
Multiplying weights by a constant less than 1
- B
Adding a penalty proportional to the absolute value of the weights
- C
Adding a penalty proportional to the square of the weights to the loss function
- D
Removing layers with small weights
Correct answer
CAdding a penalty proportional to the square of the weights to the loss function
Explanation
L2 regularization (weight decay) adds the sum of squared weights to the loss, encouraging smaller weights.
- A
- 41
Which activation function is typically used for the output layer in multi-class classification?
- A
ReLU
- B
Softmax
- C
Tanh
- D
Sigmoid
Correct answer
BSoftmax
Explanation
Softmax converts logits into a probability distribution over classes that sums to 1.
- A
- 42
What is the appropriate loss function for multi-class classification with integer labels?
- A
SparseCategoricalCrossentropy
- B
BinaryCrossentropy
- C
CategoricalCrossentropy
- D
MeanSquaredError
Correct answer
ASparseCategoricalCrossentropy
Explanation
SparseCategoricalCrossentropy is used when labels are integers (not one-hot encoded).
- A
- 43
What does TopK categorical accuracy measure?
- A
Accuracy for the top K classes in the dataset
- B
Precision at top K
- C
Accuracy when the true class is among the top-K predicted classes
- D
Accuracy when only the top-1 prediction is correct
Correct answer
CAccuracy when the true class is among the top-K predicted classes
Explanation
Top-K accuracy checks if the correct label appears in the top K predictions.
- A
- 44
What is the file format for HDF5 model files?
- A
A format specific to TensorFlow
- B
A compressed archive of model weights
- C
A text-based format for model architecture
- D
A format for storing numerical arrays and trained models in a hierarchical structure
Correct answer
DA format for storing numerical arrays and trained models in a hierarchical structure
Explanation
HDF5 (Hierarchical Data Format) is a binary format for storing large numerical datasets and neural network models.
- A
- 45
Which CNN architecture introduced residual blocks to enable training of very deep networks?
- A
MobileNet
- B
VGGNet
- C
ResNet
- D
AlexNet
Correct answer
CResNet
Explanation
ResNet introduced skip connections (residual blocks) to mitigate the vanishing gradient problem.
- A
- 46
What is a key characteristic of VGGNet?
- A
Uses large 11x11 filters
- B
Includes residual connections
- C
Stacks many layers with small 3x3 filters
- D
Uses depthwise separable convolutions
Correct answer
CStacks many layers with small 3x3 filters
Explanation
VGGNet showed that using multiple small 3x3 filters is more effective than larger filters.
- A
- 47
What is the main innovation of MobileNet?
- A
Using multiple GPUs for training
- B
Compound scaling of depth, width, and resolution
- C
Deep residual learning
- D
Depthwise separable convolutions for efficiency
Correct answer
DDepthwise separable convolutions for efficiency
Explanation
MobileNet uses depthwise separable convolutions to reduce computational cost.
- A
- 48
Which architecture uses compound scaling to uniformly scale depth, width, and resolution?
- A
AlexNet
- B
MobileNet
- C
EfficientNet
- D
ResNet
Correct answer
CEfficientNet
Explanation
EfficientNet's compound scaling method scales all three dimensions simultaneously for optimal performance.
- A
- 49
In transfer learning, what is the typical first step after loading a pre-trained model?
- A
Replace the final classification layers and freeze the base model
- B
Only fine-tune the first few layers
- C
Unfreeze all layers and train with a high learning rate
- D
Train from scratch on the new dataset
Correct answer
AReplace the final classification layers and freeze the base model
Explanation
First, the pre-trained base is used as a feature extractor (frozen), and new dense layers are added and trained.
- A
- 50
What is fine-tuning in the context of transfer learning?
- A
Training only the new classifier layers
- B
Using the pre-trained model without any training
- C
Replacing all layers with new ones
- D
Unfreezing some or all layers of the pre-trained model and training with a low learning rate
Correct answer
DUnfreezing some or all layers of the pre-trained model and training with a low learning rate
Explanation
Fine-tuning involves unfreezing parts of the base model and training them with a small learning rate to adapt to the new task.
- A
- 51
What do early layers in a CNN typically learn?
- A
High-level concepts like faces
- B
Final classification probabilities
- C
Object parts like wheels and eyes
- D
Low-level features like edges and colors
Correct answer
DLow-level features like edges and colors
Explanation
Early layers capture simple patterns like edges, colors, and textures.
- A
- 52
How does Grad-CAM generate a heatmap for a model's prediction?
- A
By averaging all feature maps
- B
By computing the gradient of the target class score with respect to the final convolutional feature maps
- C
By backpropagating through the fully connected layers only
- D
By using the last pooling layer's output
Correct answer
BBy computing the gradient of the target class score with respect to the final convolutional feature maps
Explanation
Grad-CAM uses the gradients flowing into the last convolutional layer to produce a localization map.
- A
- 53
In Vision Transformers, how is an image processed?
- A
By applying a large convolutional filter
- B
By using recurrent neural networks
- C
By splitting into fixed-size patches and linearly projecting them to embeddings
- D
As a single vector of pixel values
Correct answer
CBy splitting into fixed-size patches and linearly projecting them to embeddings
Explanation
ViTs divide the image into patches (e.g., 16x16), flatten each, and project to a sequence of patch embeddings with added positional embeddings.
- A
- 54
What is the role of the class embedding in a Vision Transformer?
- A
It is the average of all patch embeddings
- B
It is a learnable token prepended to the patch sequence used for classification
- C
It represents the number of classes
- D
It replaces the positional embeddings
Correct answer
BIt is a learnable token prepended to the patch sequence used for classification
Explanation
A special [CLS] token (class embedding) is added to the sequence; its final representation is used for classification.
- A
- 55
Why do Vision Transformers often require large-scale pre-training?
- A
Because they have fewer parameters than CNNs
- B
Because they lack the inductive biases of CNNs (locality, translation equivariance)
- C
Because they cannot use transfer learning
- D
Because they only work with very large images
Correct answer
BBecause they lack the inductive biases of CNNs (locality, translation equivariance)
Explanation
ViTs lack built-in spatial priors, so they need large datasets to learn these patterns from scratch.
- A
- 56
What is the ONNX format used for?
- A
An open format for exchanging models between different deep learning frameworks
- B
A format for compressing images
- C
A format for training data
- D
Saving trained models in a framework-specific format
Correct answer
AAn open format for exchanging models between different deep learning frameworks
Explanation
ONNX (Open Neural Network Exchange) allows interoperability between frameworks like TensorFlow and PyTorch.
- A
- 57
What is quantization in the context of model deployment?
- A
Reducing the number of layers in the model
- B
Splitting the model into multiple parts
- C
Increasing the model precision to 64-bit
- D
Converting model weights from 32-bit floats to lower-bit representations
Correct answer
DConverting model weights from 32-bit floats to lower-bit representations
Explanation
Quantization reduces memory and speeds up inference by using smaller data types like 8-bit integers.
- A
- 58
What is Quantization-Aware Training (QAT)?
- A
Only using quantized data for training
- B
Simulating quantization effects during training to produce a model more robust to quantization
- C
Training a model with full precision then quantizing it
- D
A method to reduce training time
Correct answer
BSimulating quantization effects during training to produce a model more robust to quantization
Explanation
QAT incorporates quantization error into training, resulting in better accuracy after quantization.
- A
- 59
Which TensorFlow library is used for deploying models on mobile and IoT devices?
- A
TensorFlow Lite
- B
TensorFlow Extended (TFX)
- C
TensorFlow.js
- D
TensorFlow Serving
Correct answer
ATensorFlow Lite
Explanation
TensorFlow Lite is designed for on-device inference with reduced model size and optimized performance.
- A
- 60
What is FastAPI used for in the deployment pipeline?
- A
Creating a REST API for serving model predictions
- B
Visualizing model metrics
- C
Storing training data
- D
Training machine learning models
Correct answer
ACreating a REST API for serving model predictions
Explanation
FastAPI is a web framework for building APIs; it serves model predictions via HTTP endpoints.
- A
- 61
What is the purpose of load testing with Locust?
- A
To measure model accuracy under different conditions
- B
To simulate multiple users accessing the API simultaneously to test performance
- C
To generate training data
- D
To reduce the model size
Correct answer
BTo simulate multiple users accessing the API simultaneously to test performance
Explanation
Locust creates simulated users to stress-test the API and find bottlenecks.
- A
- 62
In YOLO, how is the input image divided?
- A
Into overlapping patches
- B
By region proposals
- C
By using a sliding window
- D
Into a grid of equal cells
Correct answer
DInto a grid of equal cells
Explanation
YOLO divides the image into an SxS grid; each cell is responsible for predicting objects whose center falls in that cell.
- A
- 63
What does each grid cell in YOLO predict?
- A
Only a confidence score
- B
Only class probabilities
- C
One bounding box and class
- D
B bounding boxes, confidence scores, and class probabilities
Correct answer
DB bounding boxes, confidence scores, and class probabilities
Explanation
Each cell predicts B bounding boxes, each with a confidence, and C class probabilities, outputting a tensor of shape SxSx(B*5+C).
- A
- 64
In YOLO, how are bounding box coordinates encoded relative to the grid cell?
- A
x,y are relative to the cell; width and height are relative to the image
- B
All coordinates are absolute pixel values
- C
Coordinates are normalized by the image dimensions
- D
x,y are relative to the image; width and height are relative to the cell
Correct answer
Ax,y are relative to the cell; width and height are relative to the image
Explanation
The center (x,y) is offset within the cell (0-1), and width/height are scaled by image dimensions.
- A
- 65
What component of the YOLO loss penalizes incorrect bounding box dimensions?
- A
Objectness loss
- B
No-objectness loss
- C
Coordinate loss
- D
Classification loss
Correct answer
CCoordinate loss
Explanation
The coordinate loss measures error in predicted box center, width, and height.
- A
- 66
What metric is used to determine which predicted box is responsible for an object in YOLO?
- A
Euclidean distance between centers
- B
Mean squared error
- C
Intersection over Union (IoU)
- D
Cosine similarity
Correct answer
CIntersection over Union (IoU)
Explanation
IoU measures overlap between ground truth and predicted boxes; the box with highest IoU is assigned to the object.
- A
- 67
What is the purpose of Non-Max Suppression (NMS) in object detection?
- A
To classify detected objects
- B
To refine bounding box coordinates
- C
To eliminate duplicate bounding boxes by suppressing low-confidence overlapping boxes
- D
To increase the number of detections
Correct answer
CTo eliminate duplicate bounding boxes by suppressing low-confidence overlapping boxes
Explanation
NMS selects the highest-confidence box and suppresses other boxes with high IoU overlap.
- A
- 68
What is the key difference between a standard autoencoder and a variational autoencoder (VAE)?
- A
VAE outputs parameters of a probability distribution (mean and variance) and uses the reparameterization trick
- B
VAE outputs a deterministic latent code
- C
VAE does not use an encoder
- D
VAE only works with images
Correct answer
AVAE outputs parameters of a probability distribution (mean and variance) and uses the reparameterization trick
Explanation
VAE encodes input as a distribution (mean, log variance) and samples latent vectors using z = mean + sigma*epsilon.
- A
- 69
What does the KL divergence term in the VAE loss function do?
- A
Regularizes the latent space to approximate a standard normal distribution
- B
Reconstructs the input image
- C
Measures the accuracy of the decoder
- D
Increases the variance of the encoder
Correct answer
ARegularizes the latent space to approximate a standard normal distribution
Explanation
KL divergence encourages the learned distribution to be close to a prior (typically standard normal), enabling smooth interpolation.
- A
- 70
In a Generative Adversarial Network (GAN), what is the goal of the generator?
- A
To reconstruct the input
- B
To distinguish real from fake data
- C
To generate realistic data that can fool the discriminator
- D
To classify data into categories
Correct answer
CTo generate realistic data that can fool the discriminator
Explanation
The generator creates synthetic data to maximize the discriminator's error.
- A
- 71
What is the training objective of a GAN?
- A
Train both networks to reconstruct the input
- B
Maximize the generator loss and minimize the discriminator loss
- C
Minimize a combined loss of generator and discriminator
- D
A min-max game where the generator tries to fool the discriminator, and the discriminator tries to not be fooled
Correct answer
DA min-max game where the generator tries to fool the discriminator, and the discriminator tries to not be fooled
Explanation
The GAN minimax objective: generator minimizes log(1-D(G(z))), discriminator maximizes log(D(x)) + log(1-D(G(z))).
- A
- 72
Which of the following is a tip for stable GAN training?
- A
Train discriminator for many steps per generator step
- B
Use label smoothing (e.g., replace 1s with 0.9 for real labels)
- C
Remove activation functions
- D
Use a high learning rate
Correct answer
BUse label smoothing (e.g., replace 1s with 0.9 for real labels)
Explanation
Label smoothing (soft labels) prevents the discriminator from being overconfident and improves training stability.
- A
- 73
What activation function is recommended in DCGAN for the discriminator (except output)?
- A
Sigmoid
- B
Leaky ReLU
- C
Tanh
- D
ReLU
Correct answer
BLeaky ReLU
Explanation
Leaky ReLU is recommended to avoid sparse gradients in the discriminator; it allows a small gradient for negative inputs.
- A

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