Skip to contents

Layer normalization: per-sample, across features (Geron Ch 11, morie.fn hmlntr)

Usage

morie_geron_layer_normalization_hmlntr(x, gamma = 1, beta = 0, eps = 1e-05)

Arguments

x

Matrix (m,d) or vector.

gamma, beta

Per-feature scale/shift.

eps

Variance floor.

Value

List with y, x_hat, mu, var, estimate, n, method.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_layer_normalization_hmlntr(V)
#> $y
#>           [,1]      [,2]      [,3]       [,4]      [,5]     [,6]     [,7]
#> [1,] -1.527524 -1.091088 -0.654653 -0.2182177 0.2182177 0.654653 1.091088
#>          [,8]
#> [1,] 1.527524
#> 
#> $x_hat
#>           [,1]      [,2]      [,3]       [,4]      [,5]     [,6]     [,7]
#> [1,] -1.527524 -1.091088 -0.654653 -0.2182177 0.2182177 0.654653 1.091088
#>          [,8]
#> [1,] 1.527524
#> 
#> $mu
#> [1] 4.5
#> 
#> $var
#> [1] 5.25
#> 
#> $gamma
#> [1] 1 1 1 1 1 1 1 1
#> 
#> $beta
#> [1] 0 0 0 0 0 0 0 0
#> 
#> $estimate
#> [1] 0
#> 
#> $n
#> [1] 1
#> 
#> $method
#> [1] "Layer normalization (per-sample, across features)"
#>