Skip to contents

W = A (x) B. rank(A (x) B) = rank(A) rank(B), so KronA can be full rank at LoRA's parameter count; the rank is reported.

Usage

morie_kamath_ch4_kronecker_product(A, B)

Arguments

A, B

Matrices.

Value

List with W, shape, rank, n_params.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_kamath_ch4_kronecker_product(V, V)
#> $W
#>       [,1]
#>  [1,]    1
#>  [2,]    2
#>  [3,]    3
#>  [4,]    4
#>  [5,]    5
#>  [6,]    6
#>  [7,]    7
#>  [8,]    8
#>  [9,]    2
#> [10,]    4
#> [11,]    6
#> [12,]    8
#> [13,]   10
#> [14,]   12
#> [15,]   14
#> [16,]   16
#> [17,]    3
#> [18,]    6
#> [19,]    9
#> [20,]   12
#> [21,]   15
#> [22,]   18
#> [23,]   21
#> [24,]   24
#> [25,]    4
#> [26,]    8
#> [27,]   12
#> [28,]   16
#> [29,]   20
#> [30,]   24
#> [31,]   28
#> [32,]   32
#> [33,]    5
#> [34,]   10
#> [35,]   15
#> [36,]   20
#> [37,]   25
#> [38,]   30
#> [39,]   35
#> [40,]   40
#> [41,]    6
#> [42,]   12
#> [43,]   18
#> [44,]   24
#> [45,]   30
#> [46,]   36
#> [47,]   42
#> [48,]   48
#> [49,]    7
#> [50,]   14
#> [51,]   21
#> [52,]   28
#> [53,]   35
#> [54,]   42
#> [55,]   49
#> [56,]   56
#> [57,]    8
#> [58,]   16
#> [59,]   24
#> [60,]   32
#> [61,]   40
#> [62,]   48
#> [63,]   56
#> [64,]   64
#> 
#> $shape
#> [1] 64  1
#> 
#> $rank
#> [1] 1
#> 
#> $n_params
#> [1] 16
#> 
#> $estimate
#> [1] 1
#> 
#> $n
#> [1] 64
#> 
#> $method
#> [1] "Kronecker product (Kamath Eq 4.6)"
#>