Normalization (machine learning): Difference between revisions

Content deleted Content added
Line 31:
# Mean and variance of each feature
mu = np.mean(x, axis=0) # shape (N,)
sigma2var = np.var(x, axis=0) # shape (N,)
 
# Normalize the activations
x_hat = (x - mu) / np.sqrt(sigma2var + epsilon) # shape (B, N)
 
# Apply the linear transform