Skip to contents

Summed -log p over the suffix, averaged over sequences. T_p is a 0-BASED prefix length, so the suffix starts at column T_p.

Usage

morie_kamath_ch9_simvlm_prefixlm(theta, x, T_p)

Arguments

theta

Optional model.

x

Probability rows.

T_p

Prefix length.

Value

List with estimate, per_sequence, n_suffix_tokens.

Examples

morie_kamath_ch9_simvlm_prefixlm(NULL, matrix(c(0.5, 0.5, 0.5,
    0.25, 0.25, 0.5), 2), 1)
#> $estimate
#> [1] 2.079442
#> 
#> $per_sequence
#> [1] 2.079442 2.079442
#> 
#> $prefix_length
#> [1] 1
#> 
#> $n_suffix_tokens
#> [1] 2
#> 
#> $n
#> [1] 2
#> 
#> $method
#> [1] "PrefixLM suffix negative log-likelihood (Kamath Eq 9.11)"
#>