0% found this document useful (0 votes)
25 views8 pages

Deep Learning Concepts and Calculations

The document contains a comprehensive set of numerical and analytical questions related to deep learning, covering topics such as feedforward networks, backpropagation, convolutional models, autoencoders, transfer learning, and generative models. Each module includes both numerical computations and conceptual questions aimed at assessing understanding of deep learning principles and techniques. The questions are designed for a deep learning course and span various aspects of the field, including practical calculations and theoretical discussions.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views8 pages

Deep Learning Concepts and Calculations

The document contains a comprehensive set of numerical and analytical questions related to deep learning, covering topics such as feedforward networks, backpropagation, convolutional models, autoencoders, transfer learning, and generative models. Each module includes both numerical computations and conceptual questions aimed at assessing understanding of deep learning principles and techniques. The questions are designed for a deep learning course and span various aspects of the field, including practical calculations and theoretical discussions.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DEEP LEARNING QUESTION

Aradhana Behura
October 2025

Part A: Numerical Questions


Module 1: Introduction to Deep Feedforward Net-
works
1. A single-hidden-layer MLP solves XOR with architecture 2 → 2 → 1.
Using sigmoid activations and weights:

W1 = 5555, b1 = −2.5 − 7.5, W2 = 10 − 10, b2 = −5

Compute the network output (before thresholding) for inputs (0, 0), (0, 1),
(1, 0), (1, 1).
2. For a 3-layer MLP (784 → 128 → 64 → 10) with ReLU activations,
compute the total number of trainable parameters (including biases).
3. A softmax output layer has logits [2.0, 0.5, −1.0]. Compute the softmax
probabilities and cross-entropy loss for true class 1.

Module 2: Backpropagation and Optimization


4. Given a single neuron y = σ(wx+b) with sigmoid activation, where x = 2,
∂L
w = 0.4, b = −0.1, and target t = 1, compute ∂w for L = 12 (y − t)2 .

5. Perform one SGD update with learning rate η = 0.05 on w from Q4.
6. Adam update: given gt = 0.1, mt−1 = 0, vt−1 = 0, β1 = 0.9, β2 = 0.999,
ϵ = 10−8 , α = 0.001, compute mt , vt , m̂t , vˆt , and ∆w.
7. For w = [0.5, −0.2, 0.1], λ = 0.01, gradient [0.3, −0.1, 0.05], and batch size
50, compute the regularized gradient with L2 penalty.

8. Perform gradient checking for f (w) = w3 at w = 2, comparing analytical


vs. numerical gradient (with ϵ = 10−4 ). Report percentage error.

1
Module 3: Convolutional and Sequential Models
9. A 2D convolutional layer with input 32×32×3, 16 filters of size 5×5, stride
1, padding 2. Compute the output spatial size and number of parameters.
10. Apply a 2×2 max-pooling layer with stride 2 to the result of Q9. Compute
the new spatial size.
11. For depthwise separable convolution: input 64 × 64 × 64, depthwise kernel
3 × 3, pointwise 128 filters. Compare parameter count vs. standard 3 × 3
convolution. Compute % reduction.
12. FFT convolution: direct method costs N 2 multiplications, FFT-based
costs 3N log2 N . For N = 2048, compute ratio of direct/FFT multiplica-
tions.
13. 1D CNN for text: input length 100, embedding dim 300, kernel size 5, 200
filters, stride 1, no padding. Compute output length and parameters.
14. Vanilla RNN: hidden size 50, input size 20. Compute parameters for Wxh ,
Whh , and bh .
15. LSTM: input size 40, hidden size 64. Compute total parameters consider-
ing 4 gates.
16. Sequence length 30 through the LSTM of Q15 with batch size 32. Estimate
number of multiply-accumulate operations (MACs) in one forward pass.

Module 4: Linear Factor Models and Autoen-


coders
17. PCA eigenvalues [5.0, 2.0, 1.0, 0.5]. Compute variance retained by top-2
PCs and minimum k for at least 95% variance.
18. PPCA: latent dim q = 2, data dim d = 5, isotropic noise σ 2 = 0.1.
Compute parameter count for loading matrix and mean vector.
19. ICA demixing matrix:
W = 2113
T
Given x = [1, 2] , compute sources s = W x.
20. Undercomplete autoencoder: input d = 256, bottleneck k = 32, linear
encoder-decoder with biases. Compute total parameters.
21. Denoising AE: MSE reconstruction loss reduced from 0.120 to 0.084 after
adding Gaussian noise (σ = 0.1). Compute relative (%) improvement.
22. Variational Autoencoder: encoder outputs µ = [0.5, −0.2], log σ 2 = [−0.7, 0.3].
Compute KL divergence from N (0, I).

2
Module 5: Representation Learning and Transfer
Learning
23. Transfer learning: CNN pretrained on ImageNet (25.6M params). You
freeze first 20M and train the rest, with head (2M) learning rate 5 × 10−3
and rest 1×10−3 . Compute trainable parameters and ratio of head params.
24. Domain adaptation: source error 10%, target error 22%, discrepancy 0.08,
λ = 0.02. Using
ϵT (h) ≤ ϵS (h) + disc(S, T ) + λ,
compute the theoretical bound and compare with observed error.
25. Greedy layer-wise pretraining: each new layer reduces validation loss by
factor 0.9. Starting at 0.50, find loss after 5 layers.

Module 6: Generative Models (GANs, Trans-


formers)
26. GAN (non-saturating loss): LG = −Ez [log D(G(z))]. If average D(G(z)) =
0.35 over a batch of 64, compute scalar loss value.
27. At minimax equilibrium (pg = pdata ), compute V (D∗ , G) = − log 4 and
give its decimal value.
28. Transformer multi-head attention: dmodel = 512, h = 8. Compute dk and
parameter count for WQ , WK , WV (512 × 512 each) and WO (512 × 512).
29. Self-attention complexity: sequence length n = 256, d = 512. Compute
O(n2 d) operations numerically and compare with linear attention O(nd).
Give ratio.
30. Byte-Pair Encoding: merging pairs (A, B) freq 120, (B, C) freq 80, (A, C)
freq 30. Perform 50 merges picking highest frequency each step. How
many times will (A, B) be chosen in first 3 merges, and how many new
tokens are created?

Conceptual Questions in Deep Learning (CS40001)

Part B: Analytical Questions


Module 1: Introduction to Deep Learning
1. What are the main differences between shallow and deep neural networks?
2. Explain the role of activation functions in neural networks. Why is ReLU
preferred over sigmoid in deeper layers?

3
3. What is the universal approximation theorem? What does it imply about
neural networks?
4. Differentiate between empirical risk minimization and structural risk min-
imization.

5. Discuss the challenges of training deep networks and how initialization


affects convergence.

Module 2: Backpropagation and Optimization


6. Describe the main steps of the backpropagation algorithm.
7. Why is vanishing gradient a problem in deep networks? Which activations
suffer from it the most?
8. Compare SGD, Momentum, RMSProp, and Adam optimizers in terms of
their update rules and convergence.

9. What is the significance of learning rate scheduling? Give examples of


common schedules.
10. Explain the difference between batch, mini-batch, and stochastic gradient
descent.

Module 3: Convolutional and Recurrent Networks


11. Why are convolutional layers more efficient than fully connected layers for
image data?

12. Explain the concept of receptive field in CNNs and how it grows with layer
depth.
13. What is the purpose of pooling layers? Compare max-pooling and average-
pooling.
14. Discuss the difference between 1D, 2D, and 3D convolutions with exam-
ples.
15. Explain the vanishing gradient problem in RNNs and how LSTMs/GRUs
address it.
16. Compare CNNs and RNNs in terms of architecture, input structure, and
use cases.

4
Module 4: Autoencoders and Representation Learn-
ing
17. What is the objective of an autoencoder? How does it differ from PCA?
18. Define undercomplete, overcomplete, and sparse autoencoders.
19. Explain the role of the latent (bottleneck) representation in an autoen-
coder.
20. What is the difference between deterministic autoencoders and variational
autoencoders?
21. Describe the KL divergence term in VAE loss. Why is it important?
22. What are the benefits of using denoising autoencoders in feature learning?

Module 5: Transfer Learning and Domain Adap-


tation
23. What is transfer learning? How can pretrained models be fine-tuned for
new tasks?
24. Differentiate between feature extraction and fine-tuning in transfer learn-
ing.
25. What are domain shift and domain adaptation? Provide an example.
26. How does multi-task learning improve model generalization?
27. Explain the concept of representation learning and why it is central to
deep learning.

Module 6: Generative Models and Transformers


28. Explain the difference between discriminative and generative models with
examples.
29. What is the fundamental training objective of a GAN? How do the gen-
erator and discriminator interact?
30. Describe the architecture of a Transformer model and its advantages over
RNNs.
31. What is the self-attention mechanism? How does it compute contextual
dependencies?
32. Discuss the applications of generative models such as VAEs, GANs, and
Transformers in modern AI.
Neural Style Transfer (NST): Conceptual and Numerical Questions

5
Part C: Conceptual Questions
1. What is Neural Style Transfer (NST)? Explain its motivation and real-
world applications.
2. Describe the difference between content representation and style represen-
tation in NST.
3. How does a pre-trained CNN (such as VGG-19) help in extracting content
and style features for NST?
4. Explain why convolutional layers from different depths are used for com-
puting content and style loss.
5. What is the Gram matrix? Why is it used to represent style in NST?

6. Write the mathematical form of the total loss function in NST and explain
each term.
7. How are the gradients computed in NST when updating the generated
image?

8. Why is the generated image optimized instead of the network weights in


NST?
9. Discuss how layer selection affects the artistic quality of the generated
image.
10. Compare Neural Style Transfer with image-to-image translation models
like CycleGAN.
11. What are the advantages and limitations of classical NST based on opti-
mization?
12. Explain the concept of perceptual loss. How does it differ from pixel-wise
loss?
13. What is fast neural style transfer? How does it differ from the original
optimization-based NST?
14. Describe how instance normalization improves the performance of fast
style transfer networks.

15. List and briefly describe at least three applications of Neural Style Transfer
beyond art generation.

6
Part D: Numerical / Analytical Questions
16. The content loss is defined as:
1X l
Lcontent = (F − Pijl )2
2 i,j ij

where Fijl and Pijl are feature activations of the generated and content
images at layer l. Given F l = [1, 2, 3], P l = [2, 2, 4], compute Lcontent .
17. For a style layer l, the Gram matrix Gl is defined as:
X
Glij = l
Fik l
Fjk
k

Given F l = 12
34, compute the Gram matrix Gl .
18. The style loss for one layer is:
1 X
El = (Glij − Alij )2
4Nl2 Ml2 i,j

If Nl = 2, Ml = 2, and

Gl = 10141420, Al = 9131319,

compute El .
19. The total NST loss is:

Ltotal = αLcontent + βLstyle

If Lcontent = 5, Lstyle = 25, α = 1, and β = 10−3 , compute Ltotal .


20. Assume the optimizer performs gradient descent with step size η = 0.1. If
the gradient of loss w.r.t pixel intensity is ∇I = 0.4, compute the updated
pixel intensity Inew = I − η∇I for I = 120.
21. Suppose the content representation is taken from layer conv4 2 of VGG-
19 and style representations from conv1 1, conv2 1, conv3 1, conv4 1,
conv5 1. If each layer contributes equally and total style weight β = 1,
compute per-layer style weight.
22. During optimization, the loss reduces from 1200 to 400 in 200 iterations.
Compute the average reduction in loss per iteration.
23. A generated image’s content loss is reduced by 30% and style loss by 10%
after 100 iterations. If initial Lc = 200 and Ls = 300, compute new values
of each and the new total loss with α = 1, β = 10−3 .

7
24. Given a feature map tensor of size (64, 128, 128), compute the size of its
Gram matrix.
25. For an NST experiment, style weight β is increased by a factor of 10.
Describe and quantify how the style features’ dominance changes relative
to content loss in the total objective.

Common questions

Powered by AI

Dimensionality reduction techniques like PCA reduce data complexity while retaining essential structures by projecting data to a lower-dimensional space along principal components of maximum variance. The role in feature learning involves noise reduction, improving algorithm runtime, and preventing overfitting. Variance capture relates to practical interpretation by quantifying how much of the original data's total variance each principal component explains, guiding which components can be discarded without significant information loss. Retaining sufficient variance ensures the reduced data's fidelity remains high, critical for effective model building .

Adam combines momentum and RMSProp to provide adaptive learning rates for parameter updates. It computes individual adaptive learning rates using estimates of first (mean) and second (uncentered variance) moments of gradients. Adam updates parameters using: mt = β1mt−1 + (1−β1)gt (momentum) vt = β2vt−1 + (1−β2)g^2t (RMSProp aspect) The adjustments account for sparseness and noise in gradients, which contributes to faster convergence and robustness. Default parameters β1 = 0.9, β2 = 0.999 are typically effective, making Adam suitable for various deep models .

The transformation from logits to softmax probabilities involves applying the softmax function, which rescales raw logits to probabilities that sum to 1. Given logits z = [z1, z2,...,zk], softmax is applied as: softmax(zi) = e^zi / Σ(e^zj). For cross-entropy loss, if the true class is encoded in a vector (1 among k-classes), the loss for predicted probabilities (p) is: L = -Σ(y_true[i] * log(p[i])). Mathematically, it measures the divergence between the true class and predicted probabilities, aiding in minimization during training .

Convolutional layers improve computational efficiency by using shared weights, reducing the parameters compared to fully connected layers that have unique weights for every input-output pair. For image data, these layers exploit spatial hierarchies by learning local patterns (e.g., edges, textures) that transform into complex representations (features) as layers deepen. Due to spatial weight sharing, they require fewer computations, hence, are more memory efficient. Moreover, convolutional operations are parallelizable due to their sliding window nature over the input data .

Increasing the style weight in NST emphasizes capturing style characteristics more prominently, shifting the content-style balance towards stylization. As a result, the generated image reflects textures, colors, and patterns of the style reference image more than retaining structural fidelity to the content image. However, excessive style weight could obscure content-specific details, leading to less identifiable rendering of the original content scene, highlighting the need to balance these weights carefully for desired artistic output .

Numerical gradient checking ensures the correctness of backpropagation by estimating gradients using finite difference approximations and comparing these values against analytically computed gradients. For a function f(w), the numerical gradient is approximated as f(w+ε)−f(w−ε)/2ε. By computing this on perturbed weights and comparing with gradients from backprop, discrepancies indicate potential errors in implementation. This checks the implementation's accuracy since numerical calculations are less error-prone than complex analytical derivations, given small ε .

The choice between ReLU and Sigmoid significantly impacts convergence. ReLU is preferred because of its ability to mitigate the vanishing gradient problem due to its linear growth in positive input regions, allowing for effective gradient flows in deep networks. In contrast, Sigmoid squashes input to [0,1], resulting in gradient shrinkage (vanishing gradient) as inputs push into saturation regions, impeding deeper layer training. ReLU's sparsity-inducing property (outputs zero for any negative input) also aids efficient learning .

LSTMs and GRUs tackle the vanishing gradient problem present in RNNs through their gating mechanisms. LSTMs use forget, input, and output gates to control cell state preservation, allowing gradients to flow across many time steps. This structure prevents gradient diminishing, maintaining informative signal propagation. GRUs simplify this by merging some gate functions while maintaining similar benefits of capturing long-term dependencies efficiently, thus further addressing computational inefficiency while maintaining comparable performance .

The KL divergence term in VAEs measures the difference between the learned latent distribution and a prior distribution (usually standard normal). It acts as a regularizer, ensuring the latent space captures diverse yet structured data characteristics by penalizing deviations from the prior. This alignment promotes variability in the generations while preventing overfitting. It is crucial for ensuring that samples drawn from the latent space remain coherent and capable of reconstructing varied input data faithfully .

To perform one forward pass through a three-layer MLP with architecture, e.g., 784 → 128 → 64 → 10 and ReLU activations, follow these steps: 1. Input layer: Feed the input data (dim 784) to the network. 2. First hidden layer: Compute Z1 = W1X + b1, where W1 is weight matrix (128x784), and b1 is bias (128). Apply ReLU: A1 = ReLU(Z1). 3. Second hidden layer: Compute Z2 = W2A1 + b2, where W2 is (64x128), and b2 is (64). Apply ReLU: A2 = ReLU(Z2). 4. Output layer: Compute Z3 = W3A2 + b3, where W3 is (10x64), and b3 is (10). Output is A3 = softmax(Z3). Each step uses matrix multiplication and activation application based on architecture specifics.

You might also like