Skip to contents

p(y|x) = exp(w_{M(y)}.h_z) / sum over the LABEL words only.

Usage

morie_kamath_ch3_prompt_softmax_label(w, h_z, M)

Arguments

w

Named list of answer-word vectors.

h_z

Answer-slot state.

M

Named label -> answer-word map.

Value

List with estimate, label, label_probs, logits.

Examples

morie_kamath_ch3_prompt_softmax_label(list(great = c(1, 0), terrible = c(0,
    1)), c(1, 0), list(pos = "great", neg = "terrible"))
#> $estimate
#> [1] 0.7310586
#> 
#> $label
#> [1] "pos"
#> 
#> $label_probs
#>       pos       neg 
#> 0.7310586 0.2689414 
#> 
#> $logits
#> pos neg 
#>   1   0 
#> 
#> $n
#> [1] 2
#> 
#> $method
#> [1] "label-word softmax (Kamath Eq 3.2)"
#>