Docsity

DEEP LEARNING OPTIMIZATION AND REGULARIZATION COMPLETE EXAM REVIEW WITH FULL SOLUTIONS, Exams of Advanced Algorithms

Toggle sidebar
bg1
DEEP LEARNING OPTIMIZATION AND
REGULARIZATION COMPLETE EXAM
REVIEW WITH FULL SOLUTIONS
●● How do you distinguish underfitting from overfitting in practice?
Answer: Look at the gap between train and validation loss. Underfitting:
both are high and close together (model hasn't learned). Overfitting:
train loss is low but validation loss is high (model memorised noise).
●● What is regularisation actually doing?
Answer: It injects a prior to constrain the hypothesis space. It trades a
small amount of training fit for better generalisation, preventing the
model from chasing data quirks. L2 pushes for small weights, L1 for
sparsity, augmentation encodes invariances.
●● What does the optimiser landscape look like and why does SGD
work?
Answer: In high dimensions, it's dominated by saddle points, not local
minima; there's usually an escape route. SGD works because its noisy
mini-batch estimate acts as an implicit regulariser, biasing the optimiser
away from sharp minima and toward flat, wide ones that generalise
better.
●● Why do neural networks learn at all?
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download DEEP LEARNING OPTIMIZATION AND REGULARIZATION COMPLETE EXAM REVIEW WITH FULL SOLUTIONS and more Exams Advanced Algorithms in PDF only on Docsity!

DEEP LEARNING OPTIMIZATION AND

REGULARIZATION COMPLETE EXAM

REVIEW WITH FULL SOLUTIONS

●● How do you distinguish underfitting from overfitting in practice? Answer: Look at the gap between train and validation loss. Underfitting: both are high and close together (model hasn't learned). Overfitting: train loss is low but validation loss is high (model memorised noise). ●● What is regularisation actually doing? Answer: It injects a prior to constrain the hypothesis space. It trades a small amount of training fit for better generalisation, preventing the model from chasing data quirks. L2 pushes for small weights, L1 for sparsity, augmentation encodes invariances. ●● What does the optimiser landscape look like and why does SGD work? Answer: In high dimensions, it's dominated by saddle points, not local minima; there's usually an escape route. SGD works because its noisy mini-batch estimate acts as an implicit regulariser, biasing the optimiser away from sharp minima and toward flat, wide ones that generalise better. ●● Why do neural networks learn at all?

Answer: Hierarchical feature learning (edges - > parts - > objects) combined with backpropagation, which systematically distributes credit/blame so every parameter gets a personalised, local update signal. ●● What's the real effect of batch size? Answer: Larger batches give a lower-variance gradient estimate (faster compute), but often generalise worse because they remove the implicit regularisation of small-batch gradient noise, converging to sharper minima. ●● What problem does ReLU solve and what is the 'dying' problem? Answer: It solves the vanishing gradient problem of sigmoid/tanh by keeping a constant gradient of 1 for positive inputs. The 'dying' problem occurs if a large update pushes a unit permanently below zero, killing its gradient forever (fixed by Leaky ReLU). ●● Softmax - what does it do and why exponentials? Answer: Turns logits into a probability distribution. Exponentials make everything positive and disproportionately amplify the largest logit, letting the distribution peak sharply around the most confident class. ●● Dropout - why does it help? Answer: It forces units to learn independently useful features rather than relying on co-adapted combinations. Like students in a group project: if some randomly drop out, everyone else is forced to actually learn the material.

●● Why did ViTs become popular, and when do CNNs still win? Answer: ViTs have a global receptive field from layer one and scale incredibly well with massive data. CNNs win in small data/edge environments because their built-in priors (locality/equivariance) mean they don't have to learn those structures from scratch. ●● When to use PR curves instead of ROC? Answer: Use Precision-Recall curves under heavy class imbalance (e.g., rare-event detection). ROC can look deceptively good because a massive number of true negatives keeps the false-positive rate artificially tiny. ●● Why cross-entropy rather than MSE for classification? Answer: With MSE + softmax, the gradient vanishes when a prediction is confidently wrong (saturated region). Cross-entropy's gradient is beautifully simple (predicted - true), giving a strong correction signal even when completely wrong. ●● Practical Debugging: Model is overfitting Answer: 1. Get more data/augmentation. 2. Reduce capacity. 3. Add regularisation (weight decay, dropout). 4. Early stopping. 5. Check for train/val leakage. ●● Practical Debugging: Model is underfitting

Answer: 1. Increase capacity (width/depth). 2. Train longer or raise learning rate. 3. Reduce regularisation. 4. Check for pipeline/label bugs (broken targets often look like underfitting). ●● Transfer learning vs fine-tuning (what to freeze)? Answer: Early layers learn generic features (edges), later layers learn task-specific ones. Little data: freeze early layers to prevent overfitting. Lots of data: unfreeze progressively more. ●● Why can a highly accurate model be poorly calibrated? Answer: Cross-entropy incentivises correct ranking (argmax), not correct absolute confidence. Fix via temperature scaling or label smoothing, crucial for edge systems that rely on confidence thresholds. ●● Why does edge deployment change everything? Answer: Server ML optimises accuracy subject to soft compute. Edge ML optimises accuracy subject to hard memory, latency, and power constraints known at design time. Ops without FPUs make quantisation a strict requirement, not just an optimisation. ●● Case Study: The detector misses people wearing coats. Answer: 1. Clarify if it's a recall issue or threshold issue (check logits).

  1. Check training distribution for coat-wearing examples (underrepresented group). 3. Check if coats change the silhouette too much (shape-based failure). Fix via targeted collection/augmentation.

Answer: 1. Input distribution mismatch (lighting, sensor noise, compression). 2. Preprocessing mismatch (different resize/ISP behaviour in deployment pipeline). 3. Deployed model mismatch (quantised vs float). ●● Why 'stochastic' gradients - why not just use the true gradient? Answer: Computing the exact gradient is expensive, but more importantly, the noisy mini-batch estimate acts as an implicit regulariser that helps the optimiser escape sharp minima and generalise better. ●● What does the learning rate actually control? (Intuition) Answer: It's the step size on a foggy hillside. Too small: you crawl and get stuck in shallow wobbles. Too large: you overshoot, bounce across the valley, or diverge entirely. ●● Why does momentum help? Answer: It accumulates a moving average of past gradients. This damps oscillations across steep, narrow directions while accelerating along shallow, consistent ones—like a ball with mass rolling down a valley. ●● Weight decay vs L2 regularisation: Why the difference in modern optimisers? Answer: In plain SGD, they are mathematically identical. In Adam, adding L2 to the loss gets inconsistently weakened by adaptive learning rates. AdamW explicitly decouples weight decay from the gradient update to fix this.

●● Epochs vs iterations - what's actually being counted? Answer: An iteration (step) is one gradient update from one mini-batch. An epoch is one full pass through the entire training dataset. For large- scale training, iterations/tokens seen matter more than epochs. ●● Sigmoid and tanh - when would you still use them instead of ReLU? Answer: Sigmoid: When you need an interpretable bounded probability (0,1), like the final layer of binary classification or inside LSTM gates. Tanh: When you need a zero-centred bounded signal (-1,1), like LSTM cell states. ●● What do stride, padding, and pooling each actually do? Answer: Stride: Step size of the kernel (reduces resolution if >1). Padding: Adds border values to preserve spatial size or prevent boundary data loss. Pooling: Summarises neighbourhoods, giving downsampling and local translation invariance. ●● What is a receptive field, and why does it grow with depth? Answer: It's the region of the original input that influences a unit's value. A deep network compounds these patches (e.g., stacked 3x3s see a 5x area), integrating global context to transition from local edges to whole objects. ●● Accuracy, precision, recall, specificity, F1 - when does each matter?

majority). 3. Use targeted augmentation. 4. Judge using PR-AUC or F1, not accuracy. ●● Limited labels - what are your options, roughly in order of effort? Answer: 1. Transfer learning/fine-tuning. 2. Self-supervised pretraining on unlabelled data. 3. Data augmentation. 4. Active learning. 5. Lower- variance classical methods (hand-crafted features). ●● Noisy labels - how do you diagnose and mitigate? Answer: Inspect high-loss training examples manually to find systematic errors. Mitigate with label smoothing or robust loss functions. Cross- validate to flag confident disagreements. Fix systematic upstream data- collection bugs first. ●● Augmentation - what's the underlying principle? Answer: It encodes an invariance you believe should hold ('the label shouldn't change under this transform'). It's a data-side way of injecting priors. Always choose transforms reflecting real deployment variation, not generic ImageNet recipes. ●● Quantisation - what's actually happening? Answer: It maps continuous floats (FP32) to fixed integer ranges (INT8) to shrink memory and use fast integer arithmetic on embedded chips. Post-training does it after; Quantisation-aware simulates the error during training for robustness.

●● Knowledge distillation - how and why does it work? Answer: A small 'student' model learns from a large 'teacher' model's soft labels (output distribution). Soft labels carry 'dark knowledge' about relative confidence across wrong classes, allowing massive compression without losing as much accuracy. ●● Pruning - structured vs unstructured? Answer: Unstructured zeroes out individual weights (high theoretical compression, but sparse matrices run poorly on standard hardware). Structured removes whole channels/filters, yielding a genuinely smaller, dense model that runs fast on edge devices. ●● Case Study: Edge model is too slow. Memory budget is 2 MB. Options? Answer: 1. Quantise to INT8. 2. Change architecture (depthwise- separable convs). 3. Distil into a smaller model. 4. Structured pruning. 5. Reduce input resolution or use a cheap cascade pre-filter. ●● Case Study: Two models have identical accuracy, but one is preferred. What else matters? Answer: Latency, memory footprint, and power draw (crucial for edge). Calibration profile. Failure-mode safety (are the specific errors it makes catastrophic?). Robustness to domain shift, and ease of quantisation.