Normalises each instance across its features, then applies a learned
gain and bias: y equals gamma times (x - mu) / sqrt(sigma2 + eps)
plus beta, with eps inside the square root. Statistics come from a
single training case, which is what distinguishes layer norm from
batch norm. There is exactly one implementation: this function
delegates to morie_geron_layer_normalization.
References
Ba, J. L., Kiros, J. R. and Hinton, G. E. (2016), Layer Normalization, arXiv:1607.06450, Section 3.
Examples
Layrnm(c(1, 3), eps = 0)$normalized
#> [1] -1 1
