
T5 template generation objective (Kamath Eq 3.11)
Source:R/kamath_llm2_native.R
morie_kamath_ch3_t5_template_obj.Rdsum over D_train of log P_T5(T | T(x_in, y)). A probability of 0 is refused rather than returned as -Inf.
Examples
morie_kamath_ch3_t5_template_obj(list(list("g m", "pos"), list("a m",
"neg")), "{x} It was {y}", function(T, s) 0.5)
#> $estimate
#> [1] -1.386294
#>
#> $per_example
#> [1] -0.6931472 -0.6931472
#>
#> $filled_inputs
#> [1] "g m It was pos" "a m It was neg"
#>
#> $n
#> [1] 2
#>
#> $method
#> [1] "T5 template generation objective (Kamath Eq 3.11)"
#>