Skip to contents

Max-shifted normalized exponential; k and argmax are 0-based.

Usage

morie_geron_ch4_softmax_function(s, k, K = NULL)

Arguments

s

Score vector.

k

0-based class of interest.

K

Optional length check.

Value

List with probability, probabilities, argmax.

Examples

morie_geron_ch4_softmax_function(s = c(1, 2, 3, 4, 5, 6, 7, 8), k = 5L)
#> $probability
#> [1] 0.08557692
#> 
#> $probabilities
#> [1] 0.0005766128 0.0015673960 0.0042606241 0.0115815771 0.0314819905
#> [6] 0.0855769227 0.2326221940 0.6323326828
#> 
#> $argmax
#> [1] 7
#> 
#> $estimate
#> [1] 0.08557692
#> 
#> $n
#> [1] 8
#>