internalsGet Pro

Module 09 · Lesson 6 of 11Pro

Batch and layer normalization

Level
Intermediate
Topic
Neural networks
Reading time
16 min

When you finish this page you can

  1. Compute batch normalization and layer normalization by hand for a small batch, and say which numbers each one averages.
  2. Explain why batch normalization behaves differently in training and evaluation, and find the bug when a model’s scores change with the batch.
  3. Predict how small batches hurt batch normalization, and when layer normalization is the better choice.
  4. Place a normalization layer in a PyTorch network and test that its predictions don’t depend on the batch.

Builds on 4 lessons

Start with lesson 113 min
  1. Neurons and layers: the building blocks13 min
  2. Building a neural network in PyTorch14 min
  3. Weight initialization and unstable gradients16 min
  4. The normal distribution: why it appears everywhere14 min

The same customer gets two scores

is our example online store. Every Monday, Joseph’s growth team sends vouchers to the 20,000 customers most likely to : to stop buying. Farah, an ML engineer, builds the network that ranks them.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan