Skip to contents

KronA layer output and merged weights (Kamath Eq 4.8-4.9)

Usage

morie_kamath_ch4_krona_tuned_weights(W, A_k, B_k, s)

morie_kamath_ch4_krona_output(X, W, A_k, B_k, s)

Arguments

W

Base weight.

A_k, B_k

Kronecker factors.

s

Scale.

X

Input rows.

Value

List with W_tuned, delta, shape.

Details

One merge serves both Python modules exactly as km061 imports km062's _tuned: km062 -> morie_kamath_ch4_krona_tuned_weights (W + s [A_k (x) B_k]), km061 -> morie_kamath_ch4_krona_output (that merged weight applied to X). s = 0 returns W unchanged.

Examples

morie_kamath_ch4_krona_tuned_weights(matrix(1, 2, 2), diag(2),
    matrix(1, 1, 1), 2)
#> $W_tuned
#>      [,1] [,2]
#> [1,]    3    1
#> [2,]    1    3
#> 
#> $delta
#>      [,1] [,2]
#> [1,]    2    0
#> [2,]    0    2
#> 
#> $s
#> [1] 2
#> 
#> $shape
#> [1] 2 2
#> 
#> $estimate
#> [1] 3
#> 
#> $n
#> [1] 4
#> 
#> $method
#> [1] "merged KronA weights (Kamath Eq 4.9)"
#>