Implement the layer normalization forward pass.
Signature: def layer_norm(x: np.ndarray, gamma: np.ndarray, beta: np.ndarray, eps: float = 1e-5) -> np.ndarray
Normalize across the feature dimension (last axis) for each sample independently.
Math
Related problems
Asked at
Output
Anything you print() in your code will show up here after you click Run.
Test Results