Repository navigation
Module 09
Curriculum part: Learning and Optimization
Study level: Intermediate
Content status: Substantive introductory chapter; supporting exercises and implementations are maintained separately.
Initialization, normalization and residual paths control signal scale and gradient flow in deep networks.
After studying this module, you should be able to:
- Explain the central problem and assumptions of the methods covered.
- Interpret the principal mathematical objects, equations and tensor dimensions.
- Work through a small numerical example without relying on a framework.
- Implement or verify the central operation using NumPy or PyTorch.
- Identify failure modes and select appropriate follow-up material.
Prerequisites: Modules 01, 02, 05 and 07.
The module follows the principle write once, reference everywhere. Foundational derivations are maintained in their primary module; later modules focus on how those ideas are used rather than repeating the full derivation.
Too-small initialization variance can shrink activations and gradients; too-large variance can amplify them. Xavier/Glorot is motivated by preserving variance across layers; He/Kaiming accounts for ReLU's active fraction. BatchNorm uses batch statistics in training and running estimates in inference. LayerNorm normalizes features within each example; GroupNorm partitions channels; RMSNorm scales by root-mean-square. Residual blocks add a learned correction to an identity path, giving gradients a direct route through depth.
A compact form of the central operation is:
Glorot uniform bound √(6/(fan_in+fan_out)); He normal variance 2/fan_in. Residual block
The equations above define the main computational objects. When implementing them, specify tensor shapes, reduction axes, normalization conventions and whether a loss is summed or averaged. Those details determine the actual computation.
For fan_in=100, He variance is 0.02 and standard deviation ≈0.141. This is a recommended initial scale, not a guarantee of exact variance preservation in a trained network.
Use the example as a check on notation and implementation. Change one input at a time and verify how the output changes; this is often more informative than immediately moving to a large dataset.
flowchart TD
A[Define the problem and data] --> B[Identify mathematical objects]
B --> C[Write equations and tensor shapes]
C --> D[Work through a small numerical case]
D --> E[Implement the operation]
E --> F[Verify outputs and gradients]
F --> G[Evaluate limitations and connect to later modules]
Record layerwise activation means/variances and gradient norms. Compare BatchNorm and LayerNorm under realistic batch sizes. Test residual blocks with and without projection shortcuts.
A good implementation sequence is:
- Write the operation in plain mathematical notation.
- Calculate a tiny example by hand.
- Implement the operation with NumPy.
- Compare against a trusted PyTorch operation.
- Add shape and numerical assertions.
- Only then run a larger experiment.
See the implementation roadmap for a module-specific progression.
BatchNorm may be unreliable with tiny or nonrepresentative batches. Residual addition requires compatible shapes or projection. Initialization assumptions depend on activation and fan convention.
Study pre-norm/post-norm Transformers, Fixup, LayerScale, normalization-free networks and signal-propagation theory.
These are extensions beyond the minimum conceptual foundation. Treat them as directions for further reading or experiments, not as claims that an implementation or benchmark is already complete.
This module is best studied as one integrated chapter; the lesson map divides the reading sequence without duplicating the theory.
- Lesson map — recommended reading order.
- Numerical exercises and practice — problems to test understanding.
- Implementation roadmap — coding progression.
- Research extensions — selected directions beyond the core.
- Module 10: Regularization, Generalization and Learning Theory — see how this concept is used in a later architecture or research setting.
- Module 11: Convolutional Neural Networks and Advanced CNN Architectures — see how this concept is used in a later architecture or research setting.
- Module 12: Recurrent Neural Networks, LSTM and GRU — see how this concept is used in a later architecture or research setting.
- Module 14: Transformer Architecture and Attention Mechanisms — see how this concept is used in a later architecture or research setting.
- Module 19: Generative Adversarial Networks and Variants — see how this concept is used in a later architecture or research setting.
- Module 20: Diffusion Models and Denoising Diffusion Probabilistic Models — see how this concept is used in a later architecture or research setting.
The original course material is the primary basis for the course topics in this curriculum. Mathematical prerequisites are included to make the course topics understandable from first principles. Additional modern methods are identified as extensions where appropriate. The chapter does not imply that every proposed coding exercise or research experiment has already been executed.
These sources provide canonical starting points for the concepts in this chapter. They are not a claim that every extension listed above is covered by the original course material.
- Glorot, X., & Bengio, Y. (2010). Understanding the difficulty of training deep feedforward neural networks. AISTATS.
- He, K., et al. (2015). Delving deep into rectifiers: surpassing human-level performance on ImageNet classification. ICCV.
- Ioffe, S., & Szegedy, C. (2015). Batch normalization: accelerating deep network training by reducing internal covariate shift. ICML.
- Explain the main ideas in your own words.
- Re-derive the central equations and check dimensions.
- Solve the worked example independently.
- Complete at least one numerical exercise.
- Implement and verify the central operation.
- Explain at least two limitations or failure modes.
- Follow the cross-module links relevant to your learning path.
Next: Continue to the lesson map or return to the curriculum map.
🏠 Home · 🗺️ Curriculum · 🧭 Learning paths · ❓ Question bank · 📖 Glossary · 📚 References · ✏️ Contributing
🏠 Home · 🗺️ Curriculum · 🧭 Learning paths
❓ Question bank · 📖 Glossary · 📚 References
Jump to module:
01 02 03 04 05 06 07 08 09 10 11 12
13 14 15 16 17 18 19 20 21 22 23 24