Visual explanations for machine learning

Animated explanations of machine learning, beginning with batch and layer normalization.

Focus: Visualization · Machine learning · Multiple representations

Watch the visualizations

Batch and Layer Normalization: One Score, Two Reference Frames

A test-score analogy follows one chemistry score through two different reference groups. Highlighted rows and columns, number lines, and worked calculations connect familiar classroom scores to examples and features in a neural network.

1 min 28 sec · Silent animation · Use the player controls to pause, replay, or view full screen.

Open or download Batch and Layer Normalization: One Score, Two Reference Frames

Learning goal: Distinguish normalization across examples for each feature from normalization across features within one example, and explain why the same value can yield different z-scores.

Try this: Pause before the side-by-side comparison at 1:11. Why can Lin's chemistry score be above the class average but below Lin's own average across subjects?

Read the visual explanation

A table contains ten students and five subjects. Students represent examples, and subjects represent features. Lin scores 38.5 out of 50 in chemistry, equivalent to 77%. Scores are first converted to percentages so the subjects share a common scale.

Batch normalization: the chemistry column is highlighted in blue. Its values are 77, 72, 82, 62, 77, 57, 72, 52, 62, and 57. Their mean is 67 and their population standard deviation is approximately 9.747. Subtracting the mean from Lin’s 77 and dividing by that standard deviation gives approximately +1.026. The animation repeats this operation independently for every subject column.

Layer normalization: Lin’s row is highlighted in pink. Lin’s scores are 84, 78, 87.5, 82, and 77. Their mean is 81.7 and their population standard deviation is approximately 3.868. Normalizing the chemistry score within this row gives approximately −1.215. The operation is repeated independently for every student row.

The comparison shows that Lin’s chemistry score is above the chemistry class average and below Lin’s average across subjects. The z-scores describe those reference groups; they are not new percentages or grades.

The closing formula subtracts the selected mean, divides by the square root of variance plus epsilon, and then applies learned scale and shift. The hand calculation uses epsilon zero, scale one, and shift zero. The animation identifies batch statistics during training for BatchNorm and each example’s own features for LayerNorm. There is no audio.

The learning need

Computational ideas can be difficult to understand when students encounter only notation or code. A visual representation can make an abstract process more concrete and provide another way into a challenging concept.

What I create

I create visual artifacts explaining difficult concepts, particularly in machine learning. My tools include Manim, Remotion, and AI-assisted coding.

These explanations are intended to help students develop the intuition they need to engage with mathematical and algorithmic reasoning. I use them as one representation within a broader learning experience.

How the work connects to instruction

Students develop understanding through different pathways. I pair visual explanations with targeted resources and alternative explanations for students who need additional support. Aligned challenge problems give students opportunities to explore edge cases, generalize an idea, or connect it to a more advanced application.

The shared goal is rigorous understanding, reached through multiple routes.

Explore visualization resources · All selected work