Skip to contents

Latents cross-attend to the input, then self-attend, n_iter times; output queries decode the final latent. All attention through the shared kernel, with no learned projections.

Usage

morie_geron_perceiver_io(X, Z_latent, output_queries, n_iter = 1)

Arguments

X

(M, d) input array.

Z_latent

(N, d) latent array with N < M.

output_queries

(O, d) decoding queries.

n_iter

Cross+self rounds.

Value

List with output, latent, cross_weights, latent_self_weights, output_weights, complexity_ratio.

Examples

morie_geron_perceiver_io(X = c(1, 2, 3, 4, 5, 6, 7, 8), Z_latent = c(1, 2, 3, 4, 5, 6, 7, 8),
  output_queries = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $output
#>      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,]    1    2    3    4    5    6    7    8
#> 
#> $latent
#>      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,]    1    2    3    4    5    6    7    8
#> 
#> $cross_weights
#> $cross_weights[[1]]
#>      [,1]
#> [1,]    1
#> 
#> 
#> $latent_self_weights
#> $latent_self_weights[[1]]
#>      [,1]
#> [1,]    1
#> 
#> 
#> $output_weights
#>      [,1]
#> [1,]    1
#> 
#> $complexity_ratio
#> [1] 1
#> 
#> $estimate
#>      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,]    1    2    3    4    5    6    7    8
#> 
#> $n
#> [1] 1
#>