Normalizes inputs across the feature dimension.
Examples
set.seed(1)
ln <- mlx_layer_norm(4)
x <- as_mlx(matrix(rnorm(12), 3, 4))
mlx_forward(ln, x)
#> mlx array [3 x 4]
#> dtype: float32
#> values:
#> [,1] [,2] [,3] [,4]
#> [1,] -1.0668312 1.5259182 0.23306273 -0.6921500
#> [2,] -0.9833397 -0.7005272 0.09211669 1.5917501
#> [3,] -1.0064702 -0.9834564 1.13609314 0.8538334