+10 XP

Why Normalize?

WHY: You run two experiments recording the same neurons — but the second session used louder sounds, so ALL firing rates are 3× higher. The pattern (which neurons fire more) is identical. The intensity is different. To compare patterns, you remove the magnitude.

That's normalization: divide every component by the vector's length. The result is a unit vector — same direction, length = exactly 1.

Key insight from NMA: Normalizing does NOT change direction. The arrow still points the same way — it just gets shrunk to length 1.

Two arrows showing the original vector and its normalized unit vector. Both point in the same direction but the unit vector has length 1.

Before and after normalization: same direction, length becomes 1.

x̂ = x / ‖x‖ Divide each component by the length → unit vector with length 1.

x̂ is pronounced 'x-hat'. The hat symbol means 'unit vector'.

python
import numpy as np

v = np.array([3, 4])           # length = 5
v_unit = v / np.linalg.norm(v) # normalize

print(v_unit)                  # [0.6, 0.8]
print(np.linalg.norm(v_unit))  # 1.0 — always 1 after normalization

After normalization, np.linalg.norm() always returns 1.0.

Session A neurons: [10, 50, 2] (quiet lab)
Session B neurons: [30, 150, 6] (loud lab — 3× everything)

Both normalize to the same unit vector → you can now compare the pattern of activity, not the volume.