Normalizes activations **across the batch dimension**, dramatically improving training stability and speed.
BN(x) = (x - μ_B) / √(σ²_B + ε)Where μ_B and σ²_B are the batch mean and variance.
batch_norm([1.0, 2.0, 3.0, 4.0]) → [-1.34164, -0.44721, 0.44721, 1.34164]
Round to **5 decimal places**.
Test Cases (2 visible · 1 hidden)
Case 1: Basic 4-element
Input: batch_norm([1.0,2.0,3.0,4.0])
Expected: [-1.34164, -0.44721, 0.44721, 1.34164]
Case 2: Constant batch
Input: batch_norm([5.0,5.0,5.0])
Expected: [0.0, 0.0, 0.0]
⌘↵ Run · ⌘⇧↵ Submit