



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Aspect Description Core Definition Techniques to prevent overfitting (model memorizes training data but fails on new data) Primary Goal Improve generalization - make model perform well on unseen data Problem Addressed Models with too many parameters โ Memorize noise instead of learning patterns Basic Idea Add constraints or penalties to make model simpler/more robust Trade-off Bias-Variance Tradeoff : Regularization increases bias slightly to reduce variance significantly Analogy Studying concepts vs. memorizing textbook answers WHY REGULARIZATION? THE OVERFITTING PROBLEM: text Without Regularization: Training Accuracy: 98% โ Test Accuracy: 65% โ (Overfit!) With Regularization: Training Accuracy: 92% Test Accuracy: 88% โ (Generalizes well!) REGULARIZATION TECHNIQUES
1. PARAMETER PENALTY METHODS Technique How It Works Effect When to Use L1 Regularization (Lasso) Adds absolute value of weights to loss: Loss + ฮปยทโ| w| Feature selection - forces some weights to exactly 0 Sparse models, feature selection needed L2 Regularization (^) Adds squared value of Weight decay - shrinks all General purpose,
Technique How It Works Effect When to Use (Ridge) (^) weights: Loss + ฮปยทโwยฒ weights proportionally most common Elastic Net Combines L1 + L2: Loss + ฮป ยทโ|w| + ฮป ยทโwยฒโ โ Balance of sparsity and shrinkage When unsure between L1/L Visual: text L1: Encourages โ [0, 0.3, 0, 0.7, 0] (sparse) L2: Encourages โ [0.1, 0.2, 0.1, 0.3, 0.1] (small values)
2. ARCHITECTURAL METHODS Technique How It Works Effect Key Parameters Dropout Randomly "drop" neurons during training (set to 0) Prevents co-adaptation, ensemble effect Dropout rate (0.2-0.5) DropConnect Randomly drop connections (weights) instead of neurons Similar to dropout but at weight level Drop probability Stochastic Depth Randomly skip layers during training Ensures all layers learn useful features Survival probability per layer Dropout Example: text Training: Each neuron has 20% chance of being turned off Testing: All neurons active, but weights scaled by 0. 3. DATA-BASED METHODS Technique How It Works Effect Variations Data (^) Artificially expand dataset Teaches invariance to Image: rotations, flips,
Technique How It Works Effect Implementation Weight Constraints Enforce hard limits on weight values Prevents exploding weights Max norm constraint, non- negativity constraints Early Stopping Visualization: text Epochs: 1 2 3 4 5 6 7 8 9 10 Train Loss: โ โ โ โ โ โ โ โ โ โ Val Loss: โ โ โ โ โ โ โ โ โ โ Stop here! โ โ
5. ENSEMBLE METHODS Technique How It Works Effect Variants Model Averaging Train multiple models, average predictions Reduces variance, improves stability Independent training, different initializations Bagging Train on bootstrap samples of data Reduces variance, handles noisy data Random Forests (for decision trees) Snapshot Ensembles Save model snapshots during training, ensemble them Multiple models for price of one Cyclical learning rates 6. SPECIALIZED TECHNIQUES Technique Best For How It Works Key Insight Label Smoothing Classification Replace hard 0/1 labels with soft targets (0.9/0.1) Prevents overconfidence Gradient Clipping RNNs, unstable training Clip gradients to maximum value Prevents exploding gradients
Technique Best For How It Works Key Insight Spatial Dropout CNNs Drop entire feature maps instead of individual pixels Respects spatial correlations Variational Dropout Bayesian NNs Learn dropout rate per weight Adaptive regularization PRACTICAL COMPARISON: Scenario Recommended Techniques Why Computer Vision Dropout, Data Augmentation, Batch Norm, CutMix Images have natural invariances, CNNs prone to overfitting Natural Language Dropout, Weight Decay (L2), Label Smoothing Text data often limited, models easily memorize Small Dataset Heavy Data Augmentation, Early Stopping, L Need to maximize information from limited data Large Dataset Moderate Dropout, Batch Norm, L2 Enough data, need to control capacity Recurrent Networks Dropout (variational), Gradient Clipping, Weight Tying RNNs particularly prone to overfitting Transfer Learning Fine-tuning with L2, Early Stopping, Partial freezing Pre-trained features, need to adapt carefully IMPLEMENTATION IN CODE: python _# Common regularization in Keras/TensorFlow
Parameter Typical Range Effect if Too High Effect if Too Low Early Stopping Patience
epochs Early stopping (under-trained) Overfitting Batch Size 32 - 256 Less regularization (smoother gradients) More regularization (noisy gradients) MODERN TRENDS: