Loading...
Implement layer normalization for a single vector.
Layer normalization normalizes across the feature dimension: LayerNorm(x)=σ2+ϵx−μ⋅γ+β
where μ and σ² are the mean and variance of x, γ (gain) and β (bias) are learnable parameters.
For this problem, use γ = 1 and β = 0 (no affine transform), and ε = 1e-5.
Input: Space-separated floats (the vector x) Output: Normalized vector, values rounded to 4 decimal places.
1.0 2.0 3.0
-1.2247 0.0000 1.2247