Input and output projectors (Kamath Eq 9.3, 9.19)
Usage
morie_kamath_ch9_input_projector(F_X, in_align = NULL)
morie_kamath_ch9_output_alignment(S_X, out_align = NULL)
Arguments
- F_X
Modality features.
- in_align
Matrix or function.
- S_X
Signal tokens.
- out_align
Matrix or function.
Value
List with estimate, prompts, shape.
Details
The two Python modules are the same linear map in opposite
directions: km131 -> morie_kamath_ch9_input_projector (P_X =
IN_ALIGN(F_X)), km147 -> morie_kamath_ch9_output_alignment (H_X =
OUT_ALIGN(S_X)). Both accept a matrix (right-multiplied) or a function.
Examples
morie_kamath_ch9_input_projector(matrix(c(1, 2), 1), in_align = diag(c(1,
2)))
#> $estimate
#> [1] 4.123106
#>
#> $prompts
#> [,1] [,2]
#> [1,] 1 4
#>
#> $shape
#> [1] 1 2
#>
#> $n
#> [1] 1
#>
#> $method
#> [1] "input projector P_X = IN_ALIGN(F_X) (Kamath Eq 9.3)"
#>