# Regularization, Initialization and Normalization

> Dropout, weight decay, early stopping, data augmentation, weight initialization and batch/layer normalization for stable, generalizing networks. Free notes,...

Canonical: https://www.internhack.in/roadmaps/tracks/machine-learning/regularization-and-normalization
Last updated: 2026-11-28

Dropout, weight decay, early stopping, data augmentation, weight initialization and batch/layer normalization for stable, generalizing networks.

Intermediate · about 5 hours · difficulty 3/5

Learn first: [Optimizers and Learning Rate Schedules](https://www.internhack.in/roadmaps/tracks/machine-learning/deep-learning-optimizers), [Bias, Variance and Generalization](https://www.internhack.in/roadmaps/tracks/machine-learning/bias-variance)

Deep networks have enough capacity to memorize training data. Regularization pushes them toward solutions that generalize, while initialization and normalization keep training numerically stable.

### Regularization

- **Weight decay**: penalizes large weights.
- **Dropout**: randomly zeroes activations during training; disabled at evaluation time (`model.eval()`).
- **Early stopping**: stop when validation loss stops improving; keep the best checkpoint.
- **Data augmentation**: often the most effective regularizer for images, audio and text.
- **Label smoothing**: softens one-hot targets to reduce overconfidence.

### Initialization

Random weights must be scaled so activations neither vanish nor explode through layers: **Xavier/Glorot** for tanh-like activations, **He/Kaiming** for ReLU. Frameworks choose sensible defaults, but know why.

### Normalization

- **Batch normalization**: normalizes activations using batch statistics; speeds up CNN training; behaves differently in train and eval mode, and struggles with tiny batches.
- **Layer normalization**: normalizes per example; the standard in transformers and RNNs.
- **Residual connections** (preview): skip paths that let gradients flow through very deep networks.

**Good enough to move on** when you can show on a validation curve how dropout, weight decay and augmentation each reduce overfitting, and explain the train/eval behaviour of batch norm.

## Key concepts

- **Weight decay**
- **Dropout**
- **Early stopping and checkpoints**
- **Xavier and He initialization**
- **Batch normalization**
- **Layer normalization**
- **Label smoothing**

## Mini project

Deliberately overfit an MLP on a 5,000-image subset of Fashion-MNIST, then add weight decay, dropout, batch norm and early stopping one at a time and chart the validation accuracy after each change.

## Check yourself

What goes wrong if you forget to call model.eval() before evaluating a network with dropout and batch norm?

## Free resources

- [Deep Learning (regularization chapter)](https://www.deeplearningbook.org/) (Goodfellow, Bengio, Courville)
- [Dive into Deep Learning](https://d2l.ai/) (d2l.ai)

Previous: [Optimizers and Learning Rate Schedules](https://www.internhack.in/roadmaps/tracks/machine-learning/deep-learning-optimizers) · Next: [Debugging and Running Training Experiments](https://www.internhack.in/roadmaps/tracks/machine-learning/training-debugging)

## More in Neural Network Fundamentals

- [Perceptrons and Multilayer Networks](https://www.internhack.in/roadmaps/tracks/machine-learning/neural-networks-basics)
- [Backpropagation and Autograd](https://www.internhack.in/roadmaps/tracks/machine-learning/backpropagation)
- [Activation and Loss Functions](https://www.internhack.in/roadmaps/tracks/machine-learning/activations-and-losses)
- [Optimizers and Learning Rate Schedules](https://www.internhack.in/roadmaps/tracks/machine-learning/deep-learning-optimizers)
- [Regularization, Initialization and Normalization](https://www.internhack.in/roadmaps/tracks/machine-learning/regularization-and-normalization)
- [Debugging and Running Training Experiments](https://www.internhack.in/roadmaps/tracks/machine-learning/training-debugging)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Machine Learning Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/machine-learning)
