Skip to contents

W ~ N(0, 2/fan_in) from the reference LCG, reshaped ROW-MAJOR into (fan_out, fan_in). achieved_variance uses ddof = 1.

Usage

morie_geron_he_init(fan_in, fan_out = NULL, seed = 0)

Arguments

fan_in

Positive input width.

fan_out

Positive output width; defaults to fan_in.

seed

LCG seed.

Value

List with W, target_variance, achieved_variance, achieved_mean, std, relative_error.

Examples

morie_geron_he_init(fan_in = 5L)
#> $W
#>             [,1]       [,2]        [,3]       [,4]       [,5]
#> [1,] -0.19185911  1.0574018 -0.19689763 -0.3470549 -0.6309645
#> [2,] -0.60614583 -0.5890110 -0.71231637 -0.6411955 -0.3619901
#> [3,] -0.03327784 -0.4250749  0.46900423 -0.4128755 -1.9910827
#> [4,] -0.18506698 -0.1987254  0.48688711 -0.5376991 -0.6903125
#> [5,] -0.69361229 -0.1860337  0.01520979  0.8556732 -0.1814370
#> 
#> $target_variance
#> [1] 0.4
#> 
#> $achieved_variance
#> [1] 0.3520889
#> 
#> $achieved_mean
#> [1] -0.2771383
#> 
#> $std
#> [1] 0.6324555
#> 
#> $relative_error
#> [1] 0.1197777
#> 
#> $fan_in
#> [1] 5
#> 
#> $fan_out
#> [1] 5
#> 
#> $seed
#> [1] 0
#> 
#> $estimate
#>             [,1]       [,2]        [,3]       [,4]       [,5]
#> [1,] -0.19185911  1.0574018 -0.19689763 -0.3470549 -0.6309645
#> [2,] -0.60614583 -0.5890110 -0.71231637 -0.6411955 -0.3619901
#> [3,] -0.03327784 -0.4250749  0.46900423 -0.4128755 -1.9910827
#> [4,] -0.18506698 -0.1987254  0.48688711 -0.5376991 -0.6903125
#> [5,] -0.69361229 -0.1860337  0.01520979  0.8556732 -0.1814370
#> 
#> $n
#> [1] 25
#>